DBAccessToken
Objective-C
@interface DBAccessToken : NSObject <NSSecureCoding>
Swift
class DBAccessToken : NSObject, NSSecureCoding
A Dropbox OAuth2 access token.
Stores a unique identifying key for storing in DBKeychain.
-
The OAuth2 access token.
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull accessToken;Swift
var accessToken: String { get } -
The unique identifier of the access token used for storing in
DBKeychain. Either theaccount_id(if user app) or theteam_idif (team app).Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull uid;Swift
var uid: String { get } -
The refresh token if accessToken is short-lived.
Declaration
Objective-C
@property (nonatomic, copy, readonly, nullable) NSString *refreshToken;Swift
var refreshToken: String? { get } -
The expiration time of the (short-lived) accessToken.
Declaration
Objective-C
@property (nonatomic, readonly) NSTimeInterval tokenExpirationTimestamp;Swift
var tokenExpirationTimestamp: TimeInterval { get } -
Creates a
DBAccessTokenobject for a long-lived access token.Declaration
Objective-C
+ (nonnull DBAccessToken *) createWithLongLivedAccessToken:(nonnull NSString *)accessToken uid:(nonnull NSString *)uid;Swift
class func create(withLongLivedAccessToken accessToken: String, uid: String) -> DBAccessTokenParameters
accessTokenThe OAuth2 access token retrieved from the auth flow.
uidThe unique identifier used to store in
DBKeychain.Return Value
A
DBAccessTokenobject. -
Creates a
DBAccessTokenobject for a short-lived access token.Declaration
Objective-C
+ (nonnull DBAccessToken *) createWithShortLivedAccessToken:(nonnull NSString *)accessToken uid:(nonnull NSString *)uid refreshToken:(nullable NSString *)refreshToken tokenExpirationTimestamp:(NSTimeInterval)tokenExpirationTimestamp;Swift
class func create(withShortLivedAccessToken accessToken: String, uid: String, refreshToken: String?, tokenExpirationTimestamp: TimeInterval) -> DBAccessTokenParameters
accessTokenThe OAuth2 access token retrieved from the auth flow.
uidThe unique identifier used to store in
DBKeychain.refreshTokenThe refresh token if accessToken is short-lived.
tokenExpirationTimestampThe expiration time of the (short-lived) accessToken.
Return Value
A
DBAccessTokenobject. -
Convenience method for initWithAccessToken:uid:refreshToken:tokenExpirationTimestamp: with refreshToken set to nil and tokenExpirationTimestamp set to 0.
Declaration
Objective-C
- (nonnull instancetype)initWithAccessToken:(nonnull NSString *)accessToken uid:(nonnull NSString *)uid;Swift
init(accessToken: String, uid: String) -
DBAccessToken full constructor.
Declaration
Objective-C
- (nonnull instancetype)initWithAccessToken:(nonnull NSString *)accessToken uid:(nonnull NSString *)uid refreshToken:(nullable NSString *)refreshToken tokenExpirationTimestamp: (NSTimeInterval)tokenExpirationTimestamp;Swift
init(accessToken: String, uid: String, refreshToken: String?, tokenExpirationTimestamp: TimeInterval)Parameters
accessTokenThe OAuth2 access token retrieved from the auth flow.
uidThe unique identifier used to store in
DBKeychain.refreshTokenThe refresh token if accessToken is short-lived.
tokenExpirationTimestampThe expiration time of the (short-lived) accessToken.
Return Value
An initialized instance.
View on GitHub
DBAccessToken Class Reference