Mac Developer Library

Developer

Collaboration Framework Reference CBUserIdentity Class Reference

Options
Deployment Target:

On This Page
Language:

CBUserIdentity

An object of the CBUserIdentity class represents a user identity and is used for accessing the attributes of a user identity from an identity authority. The principal attributes of CBUserIdentity are a POSIX user identifier (UID), password, and certificate.

  • Returns a Boolean value indicating whether the given password is correct for the identity.

    Declaration

    Swift

    func authenticateWithPassword(_ password: String) -> Bool

    Objective-C

    - (BOOL)authenticateWithPassword:(NSString *)password

    Parameters

    password

    The password to test for the identity.

    Return Value

    TRUE if the password is correct; otherwise, FALSE.

    Availability

    Available in OS X v10.5 and later.

  • Returns the public authentication certificate associated with a user identity.

    Declaration

    Swift

    var certificate: SecCertificate? { get }

    Objective-C

    @property(readonly, nonatomic) SecCertificateRef certificate

    Return Value

    The public authentication certificate, or nil if none exists.

    Discussion

    The Collaboration framework supports certificate-based authentication in addition to passwords. If a certificate is stored for a user identity, it will be the default method of authentication.

    When a .Mac account is associated with a user identity, the authentication certificate is automatically downloaded from the .Mac servers.

    Availability

    Available in OS X v10.5 and later.

  • isEnabled() - isEnabled Available in OS X v10.5 through OS X v10.10.3

    Returns a Boolean value indicating whether the identity is allowed to authenticate.

    Declaration

    Swift

    func isEnabled() -> Bool

    Objective-C

    - (BOOL)isEnabled

    Return Value

    TRUE if the identity can authenticate; otherwise, FALSE.

    Discussion

    If the identity does not have authentication credentials (a password or certificate), it is not able to log in. However, an identity with authentication credentials does not ensure that it is enabled. Any identity can be disabled.

    Availability

    Available in OS X v10.5 through OS X v10.10.3.

  • Returns the POSIX UID of the identity.

    Declaration

    Swift

    var posixUID: uid_t { get }

    Objective-C

    @property(readonly, nonatomic) uid_t posixUID

    Return Value

    The POSIX UID of the identity.

    Discussion

    The POSIX UID is a integer that can identify a user within an identity authority. UIDs are not guaranteed to be unique within an identity authority.

    Availability

    Available in OS X v10.5 and later.

  • Returns the user identity with the given POSIX UID in the specified identity authority.

    Declaration

    Swift

    init?(posixUID uid: uid_t, authority authority: CBIdentityAuthority)

    Objective-C

    + (CBUserIdentity *)userIdentityWithPosixUID:(uid_t)uid authority:(CBIdentityAuthority *)authority

    Parameters

    uid

    The UID of the identity you are searching for.

    authority

    The identity authority to search.

    Return Value

    The user identity with the given UID in the specified identity authority, or nil if no identity exists with the specified UID.

    Availability

    Available in OS X v10.5 and later.