public class OAuth2Credentials
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
OAuth2Credentials.Builder
Builder for OAuth2Credentials.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AUTHORIZATION_PATH |
static java.lang.String |
TOKEN_PATH |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.client.auth.oauth2.Credential |
authenticate(java.lang.String authorizationCode,
java.lang.String userId)
Authenticates using the authorization code for the user and stores the Credential in the
underlying
DataStore. |
void |
clearCredential(java.lang.String userId)
Clears the credential for the user in the underlying (@link DateStore}.
|
com.google.api.client.auth.oauth2.AuthorizationCodeFlow |
getAuthorizationCodeFlow()
Gets the underlying
AuthorizationCodeFlow. |
java.lang.String |
getAuthorizationUrl()
Gets the authorization URL to retrieve the authorization code.
|
java.lang.String |
getRedirectUri()
Gets the redirect URI.
|
com.google.api.client.auth.oauth2.Credential |
loadCredential(java.lang.String userId)
Loads the Credential for the user from the underlying
DataStore. |
public static final java.lang.String AUTHORIZATION_PATH
public static final java.lang.String TOKEN_PATH
@Nullable
public java.lang.String getAuthorizationUrl()
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic com.google.api.client.auth.oauth2.AuthorizationCodeFlow getAuthorizationCodeFlow()
AuthorizationCodeFlow.public com.google.api.client.auth.oauth2.Credential authenticate(java.lang.String authorizationCode,
java.lang.String userId)
throws AuthException
DataStore.AuthException - If the credential could not be created.public com.google.api.client.auth.oauth2.Credential loadCredential(java.lang.String userId)
throws AuthException
DataStore.AuthException - If the credential could not be loaded.public void clearCredential(java.lang.String userId)
throws AuthException
AuthException - If the credential could not be cleared.public java.lang.String getRedirectUri()