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,
com.google.api.client.http.HttpTransport transport)
Constructor allow override of transport for getting access tokens.
|
UserCredentials(String clientId,
String clientSecret,
String refreshToken,
com.google.api.client.http.HttpTransport transport,
com.google.api.client.http.GenericUrl tokenServerUrl)
Constructor allowing override of transport and URL for getting access tokens.
|
| Modifier and Type | Method and Description |
|---|---|
AccessToken |
refreshAccessToken()
Refreshes the OAuth2 acces token by getting a new access token from the refresh token
|
createScoped, createScopedRequired, fromStream, fromStream, getApplicationDefault, getApplicationDefaultgetAuthenticationType, getRequestMetadata, hasRequestMetadata, hasRequestMetadataOnly, refreshpublic 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, com.google.api.client.http.HttpTransport transport)
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.transport - HTTP object used to get acces tokens.public UserCredentials(String clientId, String clientSecret, String refreshToken, 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.transport - HTTP object used to get acces tokens.tokenServerUrl - URL of the endpoint that provides tokens.public AccessToken refreshAccessToken() throws IOException
refreshAccessToken in class OAuth2CredentialsIOExceptionCopyright © 2015 Google. All rights reserved.