public abstract class OAuth2Credentials extends Credentials
| Constructor and Description |
|---|
OAuth2Credentials()
Default constructor.
|
OAuth2Credentials(AccessToken accessToken)
Constructor with explicit access token.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAuthenticationType() |
Map<String,List<String>> |
getRequestMetadata(URI uri)
Provide the request metadata by ensuring there is a current access token and providing it
as an authorization bearer token.
|
boolean |
hasRequestMetadata() |
boolean |
hasRequestMetadataOnly() |
void |
refresh()
Refresh the token by discarding the cached token and metadata.
|
abstract AccessToken |
refreshAccessToken()
Abstract method to refresh the access token according to the specific type of credentials.
|
getRequestMetadatapublic OAuth2Credentials()
public OAuth2Credentials(AccessToken accessToken)
accessToken - Initial or temporary access token.public String getAuthenticationType()
getAuthenticationType in class Credentialspublic boolean hasRequestMetadata()
hasRequestMetadata in class Credentialspublic boolean hasRequestMetadataOnly()
hasRequestMetadataOnly in class Credentialspublic Map<String,List<String>> getRequestMetadata(URI uri) throws IOException
getRequestMetadata in class CredentialsIOExceptionpublic void refresh()
throws IOException
refresh in class CredentialsIOExceptionpublic abstract AccessToken refreshAccessToken() throws IOException
IOExceptionCopyright © 2015 Google. All rights reserved.