AuthModule
public class AuthModule : TokenRefreshing
Provides Token management.
-
Refresh the given token.
Declaration
Swift
public func refresh(refreshToken: String, completion: @escaping TokenInfoClosure)Parameters
refreshTokenThe token to refresh.
completionReturns the token data or an error.
-
Exchange an authorization code for an access token
Declaration
Swift
public func getToken(withCode code: String, completion: @escaping TokenInfoClosure)Parameters
codeAuthorization code
completionReturns the token data or an error.
-
Revokes an access or refresh token, rendering it invalid.
Declaration
Swift
public func revokeToken(token: String, completion: @escaping Callback<Void>)Parameters
tokenThe token to revoke.
completionCalled after the revocation completes
-
Downscope the token.
Declaration
Swift
public func downscopeToken(parentToken: String, scope: Set<TokenScope>, resource: String? = nil, completion: @escaping TokenInfoClosure)Parameters
parentTokenFully-scoped access token. This can be an OAuth (Managed User), JWT (App User or Service Account) or an App Token (New Box View) token.
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}
completionReturns the token data or an error.
AuthModule Class Reference