SessionProtocol
public protocol SessionProtocol
Defines methods for managing session token.
-
Gets access token
Declaration
Swift
func getAccessToken(completion: @escaping AccessTokenClosure)
Parameters
completion
Completion for obtaining access token.
Return Value
AccessTokenClosure containing either token string or error.
-
Revokes all the tokens
Declaration
Swift
func revokeTokens(completion: @escaping Callback<Void>)
Parameters
completion
Returns either empty result representing success or error.
-
Downscope the token.
Declaration
Swift
func downscopeToken(scope: Set<TokenScope>, resource: String?, sharedLink: String?, completion: @escaping TokenInfoClosure)
Parameters
scope
Scope or scopes that you want to apply to the resulting token.
resource
Full url path to the file that the token should be generated for, eg: https://api.box.com/2.0/files/{file_id}
sharedLink
Shared link to get a token for.
completion
Returns the success or an error.