Mac Developer Library

Developer

Accounts Framework Reference ACAccountCredential Class Reference

Options
Deployment Target:

On This Page
Language:

ACAccountCredential

An ACAccountCredential object encapsulates the information needed to authenticate a user. More...

Inheritance


Conforms To


Import Statement


import Accounts @import Accounts;

Availability


Available in OS X v10.8 and later.
  • Initializes an account credential using OAuth.

    Declaration

    Swift

    init!(OAuthToken token: String!, tokenSecret secret: String!)

    Objective-C

    - (instancetype)initWithOAuthToken:(NSString *)token tokenSecret:(NSString *)secret

    Parameters

    token

    The client application’s token.

    secret

    The client application’s secret token.

    Return Value

    Newly initialized account credential.

    Discussion

    Accounts can optionally use the OAuth open authentication standard to authenticate your client application. Instead of the user giving their username and password to log in, the server authenticates the user, and your client application receives a token that grants it access to specific resources for a defined duration. The authentication mechanism uses a key and secret scheme similar to the public and private keys used by ssh. A token is a unique, random string of letters and numbers that is paired with a secret to protect the token from being abused. You initialize account credentials using this token and secret token.

    To learn more about OAuth, go to Hueniverse OAuth.

    Import Statement

    import Accounts

    Availability

    Available in OS X v10.8 and later.

  • Initializes an account credential using OAuth 2.

    Declaration

    Swift

    init!(OAuth2Token token: String!, refreshToken refreshToken: String!, expiryDate expiryDate: NSDate!)

    Objective-C

    - (instancetype)initWithOAuth2Token:(NSString *)token refreshToken:(NSString *)refreshToken expiryDate:(NSDate *)expiryDate

    Parameters

    token

    The client application’s token.

    refreshToken

    The client application’s refresh token.

    expiryDate

    The date the token expires.

    Discussion

    Accounts can optionally use the OAuth open authentication standard to authenticate your client application. Instead of the user giving their username and password to log in, the server authenticates the user, and your client application receives a token that grants it access to specific resources for a defined duration. The authentication mechanism uses a key and secret scheme similar to the public and private keys used by ssh. A token is a unique, random string of letters and numbers that is paired with a secret to protect the token from being abused. You initialize account credentials using this token and secret token.

    To learn more about OAuth, go to Hueniverse OAuth.

    Import Statement

    import Accounts

    Availability

    Available in OS X v10.8 and later.

  • The token used for the credential.

    Declaration

    Swift

    var oauthToken: String!

    Objective-C

    @property(copy, nonatomic) NSString *oauthToken

    Import Statement

    import Accounts

    Availability

    Available in OS X v10.8 and later.