public class BoxDeveloperTokenAuth extends Object implements Authentication
| Modifier and Type | Class and Description |
|---|---|
static class |
BoxDeveloperTokenAuth.Builder |
| Modifier and Type | Field and Description |
|---|---|
DeveloperTokenConfig |
config
Configuration object of DeveloperTokenAuth.
|
String |
token |
TokenStorage |
tokenStorage
An object responsible for storing token.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BoxDeveloperTokenAuth(BoxDeveloperTokenAuth.Builder builder) |
|
BoxDeveloperTokenAuth(String token) |
| Modifier and Type | Method and Description |
|---|---|
AccessToken |
downscopeToken(List<String> scopes,
String resource,
String sharedLink,
NetworkSession networkSession)
Downscope access token to the provided scopes.
|
TokenStorage |
getTokenStorage() |
AccessToken |
refreshToken()
Developer token cannot be refreshed
|
AccessToken |
refreshToken(NetworkSession networkSession)
Developer token cannot be refreshed
|
String |
retrieveAuthorizationHeader() |
String |
retrieveAuthorizationHeader(NetworkSession networkSession) |
AccessToken |
retrieveToken()
Retrieves stored developer token
|
AccessToken |
retrieveToken(NetworkSession networkSession)
Retrieves stored developer token
|
void |
revokeToken()
Revoke an active Access Token, effectively logging a user out that has been previously
authenticated.
|
void |
revokeToken(NetworkSession networkSession)
Revoke an active Access Token, effectively logging a user out that has been previously
authenticated.
|
public DeveloperTokenConfig config
public final TokenStorage tokenStorage
public BoxDeveloperTokenAuth(String token)
protected BoxDeveloperTokenAuth(BoxDeveloperTokenAuth.Builder builder)
public AccessToken retrieveToken()
retrieveToken in interface Authenticationpublic AccessToken retrieveToken(NetworkSession networkSession)
retrieveToken in interface AuthenticationnetworkSession - An object to keep network session statepublic AccessToken refreshToken()
refreshToken in interface Authenticationpublic AccessToken refreshToken(NetworkSession networkSession)
refreshToken in interface AuthenticationnetworkSession - An object to keep network session statepublic String retrieveAuthorizationHeader()
retrieveAuthorizationHeader in interface Authenticationpublic String retrieveAuthorizationHeader(NetworkSession networkSession)
retrieveAuthorizationHeader in interface Authenticationpublic void revokeToken()
revokeToken in interface Authenticationpublic void revokeToken(NetworkSession networkSession)
revokeToken in interface AuthenticationnetworkSession - An object to keep network session statepublic AccessToken downscopeToken(List<String> scopes, String resource, String sharedLink, NetworkSession networkSession)
downscopeToken in interface Authenticationscopes - The scope(s) to apply to the resulting token.resource - The file or folder to get a downscoped token for. If None and shared_link None,
the resulting token will not be scoped down to just a single item. The resource should be a
full URL to an item, e.g. https://api.box.com/2.0/files/123456.sharedLink - The shared link to get a downscoped token for. If None and item None, the
resulting token will not be scoped down to just a single item.networkSession - An object to keep network session statepublic TokenStorage getTokenStorage()