OAuth2Session
public class OAuth2Session : SessionProtocol, ExpiredTokenHandling
OAuth 2 Session
-
Declaration
Swift
public func getAccessToken(completion: @escaping AccessTokenClosure) -
Handles token expiration.
Declaration
Swift
public func handleExpiredToken(completion: @escaping Callback<Void>)Parameters
completionReturns either empty result representing success or error.
-
Gets refreshed access token if necessary
Declaration
Swift
public func refreshToken(completion: @escaping AccessTokenClosure)Parameters
completionCompletion for obtaining access token.
Return Value
AccessTokenClosure containing either token string or error.
-
Declaration
Swift
public func revokeTokens(completion: @escaping Callback<Void>) -
Downscope the token.
Declaration
Swift
public func downscopeToken( scope: Set<TokenScope>, resource: String? = nil, sharedLink: String? = nil, completion: @escaping TokenInfoClosure )Parameters
scopeScope or scopes that you want to apply to the resulting token.
resourceFull url path to the file that the token should be generated for, eg: https://api.box.com/2.0/files/{file_id}
sharedLinkShared link to get a token for.
completionReturns the success or an error.
OAuth2Session Class Reference