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.

Inheritance


Conforms To


Import Statement


Swift

import Collaboration

Objective-C

@import Collaboration;

Availability


Available in OS X v10.5 and later.
  • 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.

    Import Statement

    Objective-C

    @import Collaboration;

    Swift

    import Collaboration

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    func certificate() -> Unmanaged<SecCertificate>!

    Objective-C

    - (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.

    Import Statement

    Objective-C

    @import Collaboration;

    Swift

    import Collaboration

    Availability

    Available in OS X v10.5 and later.

  • 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.

    Import Statement

    Objective-C

    @import Collaboration;

    Swift

    import Collaboration

    Availability

    Available in OS X v10.5 and later.

  • Returns the POSIX UID of the identity.

    Declaration

    Swift

    func posixUID() -> uid_t

    Objective-C

    - (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.

    Import Statement

    Objective-C

    @import Collaboration;

    Swift

    import Collaboration

    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!) -> CBUserIdentity

    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.

    Import Statement

    Objective-C

    @import Collaboration;

    Swift

    import Collaboration

    Availability

    Available in OS X v10.5 and later.