public interface OAuthFlow
OAuthFlow interface provides methods to do the OAuth2 authorization.
Thread Safety: Implementation of this interface must be thread safe.
| Modifier and Type | Method and Description |
|---|---|
AuthorizationResult |
extractAuthorizationResult(String authorizationResponseURL)
Extract AuthorizationResult from the authorization response URL (i.e.
|
String |
newAuthorizationURL(EnumSet<AccessScope> scopes,
String state)
Generate a new authorization URL.
|
Token |
obtainNewToken(AuthorizationResult authorizationResult)
Obtain a new token using AuthorizationResult.
|
Token |
refreshToken(Token token)
Refresh token.
|
void |
revokeAccessToken(Token token)
Revoke access token.
|
String newAuthorizationURL(EnumSet<AccessScope> scopes, String state)
Generate a new authorization URL.
scopes - the requested scopesstate - an arbitrary string that will be returned to your app; intended to be used by you to ensure that
this redirect is indeed from an OAuth flow that you initiated.IllegalArgumentException - if scopes is null or emptyAuthorizationResult extractAuthorizationResult(String authorizationResponseURL) throws URISyntaxException, AccessDeniedException, UnsupportedResponseTypeException, InvalidScopeException, OAuthAuthorizationCodeException
authorizationResponseURL - the authorization response urlURISyntaxException - the URI syntax exceptionAccessDeniedException - the access denied exceptionUnsupportedResponseTypeException - the unsupported response type exceptionInvalidScopeException - the invalid scope exceptionOAuthAuthorizationCodeException - the o auth authorization code exceptionIllegalArgumentException - if any other error occurred during the operationToken obtainNewToken(AuthorizationResult authorizationResult) throws OAuthTokenException, com.smartsheet.api.internal.json.JSONSerializerException, com.smartsheet.api.internal.http.HttpClientException, URISyntaxException, InvalidRequestException
authorizationResult - the authorization resultOAuthTokenException - the o auth token exceptioncom.smartsheet.api.internal.json.JSONSerializerException - the JSON serializer exceptioncom.smartsheet.api.internal.http.HttpClientException - the http client exceptionURISyntaxException - the URI syntax exceptionInvalidRequestException - the invalid request exceptionIllegalArgumentException - if any other error occurred during the operationToken refreshToken(Token token) throws OAuthTokenException, com.smartsheet.api.internal.json.JSONSerializerException, com.smartsheet.api.internal.http.HttpClientException, URISyntaxException, InvalidRequestException
token - the token to refreshOAuthTokenException - the o auth token exceptioncom.smartsheet.api.internal.json.JSONSerializerException - the JSON serializer exceptioncom.smartsheet.api.internal.http.HttpClientException - the http client exceptionURISyntaxException - the URI syntax exceptionInvalidRequestException - the invalid request exceptionIllegalArgumentException - if any other error occurred during the operationvoid revokeAccessToken(Token token) throws OAuthTokenException, com.smartsheet.api.internal.json.JSONSerializerException, com.smartsheet.api.internal.http.HttpClientException, URISyntaxException, InvalidRequestException
token - the access token to revoke access fromOAuthTokenException - the o auth token exceptioncom.smartsheet.api.internal.json.JSONSerializerException - the JSON serializer exceptioncom.smartsheet.api.internal.http.HttpClientException - the http client exceptionURISyntaxException - the URI syntax exceptionInvalidRequestException - the invalid request exceptionCopyright © 2014–2017 Smartsheet. All rights reserved.