OAuth2Session
The protocol that an OAuth2 Session modules must adhere to and represent storage of oauth specific metadata. See TrustedPersistantOAuth2Session and UntrustedMemoryOAuth2Session as example implementations
-
The account id.
Declaration
Swift
var accountId: String {get}
-
The access token which expires.
Declaration
Swift
var accessToken: String? {get set}
-
The access token’s expiration date.
Declaration
Swift
var accessTokenExpirationDate: NSDate? {get set}
-
The refresh token’s expiration date.
Declaration
Swift
var refreshTokenExpirationDate: NSDate? {get set}
-
The refresh tokens. This toke does not expire and should be used to renew access token when expired.
Declaration
Swift
var refreshToken: String? {get set}
-
Check validity of accessToken. return true if still valid, false when expired.
Declaration
Swift
func tokenIsNotExpired() -> Bool
-
Check validity of refreshToken. return true if still valid, false when expired.
Declaration
Swift
func refreshTokenIsNotExpired() -> Bool
-
Clears any tokens storage
Declaration
Swift
func clearTokens()
-
Save tokens information. Saving tokens allow you to refresh accesstoken transparently for the user without prompting for grant access.
Declaration
Swift
func saveAccessToken(accessToken: String?, refreshToken: String?, accessTokenExpiration: String?, refreshTokenExpiration: String?)
Parameters
accessToken
the access token.
refreshToken
the refresh token.
accessTokenExpiration
the expiration for the access token.
refreshTokenExpiration
the expiration for the refresh token.