public class UserCredentials extends GoogleCredentials
| Constructor and Description |
|---|
UserCredentials(String clientId,
String clientSecret,
String refreshToken)
Constructor with minimum information and default behavior.
|
UserCredentials(String clientId,
String clientSecret,
String refreshToken,
AccessToken accessToken)
Constructor to allow both refresh token and initial access token for 3LO scenarios.
|
UserCredentials(String clientId,
String clientSecret,
String refreshToken,
AccessToken accessToken,
com.google.api.client.http.HttpTransport transport,
com.google.api.client.http.GenericUrl tokenServerUrl)
Constructor with all parameters allowing custom transport and server URL.
|
| Modifier and Type | Method and Description |
|---|---|
AccessToken |
refreshAccessToken()
Refreshes the OAuth2 access token by getting a new access token from the refresh token
|
createScoped, createScopedRequired, fromStream, fromStream, getApplicationDefault, getApplicationDefaultgetAuthenticationType, getRequestMetadata, hasRequestMetadata, hasRequestMetadataOnly, refreshgetRequestMetadatapublic UserCredentials(String clientId, String clientSecret, String refreshToken)
clientId - Client ID of the credential from the console.clientSecret - Client ID of the credential from the console.refreshToken - A refresh token resulting from a OAuth2 consent flow.public UserCredentials(String clientId, String clientSecret, String refreshToken, AccessToken accessToken)
clientId - Client ID of the credential from the console.clientSecret - Client ID of the credential from the console.refreshToken - A refresh token resulting from a OAuth2 consent flow.accessToken - Initial or temporary access token.public UserCredentials(String clientId, String clientSecret, String refreshToken, AccessToken accessToken, com.google.api.client.http.HttpTransport transport, com.google.api.client.http.GenericUrl tokenServerUrl)
clientId - Client ID of the credential from the console.clientSecret - Client ID of the credential from the console.refreshToken - A refresh token resulting from a OAuth2 consent flow.accessToken - Initial or temporary access token.transport - HTTP object used to get access tokens.tokenServerUrl - URL of the end point that provides tokens.public AccessToken refreshAccessToken() throws IOException
refreshAccessToken in class OAuth2CredentialsIOExceptionCopyright © 2015 Google. All rights reserved.