public class ComputeCredential extends Credential
Beta
Google Compute Engine service accounts OAuth 2.0 credential based on Authenticating from Google Compute
Engine.
Sample usage:
public static HttpRequestFactory createRequestFactory(
HttpTransport transport, JsonFactory jsonFactory) {
return transport.createRequestFactory(
new GoogleComputeCredential(transport, jsonFactory));
}
Implementation is immutable and thread-safe.
Inherited Members
com.google.api.client.auth.oauth2.Credential.executeRefreshToken()
com.google.api.client.auth.oauth2.Credential.getAccessToken()
com.google.api.client.auth.oauth2.Credential.getClientAuthentication()
com.google.api.client.auth.oauth2.Credential.getClock()
com.google.api.client.auth.oauth2.Credential.getExpirationTimeMilliseconds()
com.google.api.client.auth.oauth2.Credential.getExpiresInSeconds()
com.google.api.client.auth.oauth2.Credential.getJsonFactory()
com.google.api.client.auth.oauth2.Credential.getMethod()
com.google.api.client.auth.oauth2.Credential.getRefreshListeners()
com.google.api.client.auth.oauth2.Credential.getRefreshToken()
com.google.api.client.auth.oauth2.Credential.getRequestInitializer()
com.google.api.client.auth.oauth2.Credential.getTokenServerEncodedUrl()
com.google.api.client.auth.oauth2.Credential.getTransport()
com.google.api.client.auth.oauth2.Credential.handleResponse(com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse,boolean)
com.google.api.client.auth.oauth2.Credential.initialize(com.google.api.client.http.HttpRequest)
com.google.api.client.auth.oauth2.Credential.intercept(com.google.api.client.http.HttpRequest)
com.google.api.client.auth.oauth2.Credential.refreshToken()
com.google.api.client.auth.oauth2.Credential.setAccessToken(java.lang.String)
com.google.api.client.auth.oauth2.Credential.setExpirationTimeMilliseconds(java.lang.Long)
com.google.api.client.auth.oauth2.Credential.setExpiresInSeconds(java.lang.Long)
com.google.api.client.auth.oauth2.Credential.setFromTokenResponse(com.google.api.client.auth.oauth2.TokenResponse)
com.google.api.client.auth.oauth2.Credential.setRefreshToken(java.lang.String)
Static Fields
TOKEN_SERVER_ENCODED_URL
public static final String TOKEN_SERVER_ENCODED_URL
Metadata Service Account token server encoded URL.
Field Value | |
---|---|
Type | Description |
String |
Constructors
ComputeCredential(ComputeCredential.Builder builder)
protected ComputeCredential(ComputeCredential.Builder builder)
Parameter | |
---|---|
Name | Description |
builder |
ComputeCredential.Builder builder |
ComputeCredential(HttpTransport transport, JsonFactory jsonFactory)
public ComputeCredential(HttpTransport transport, JsonFactory jsonFactory)
Parameters | |
---|---|
Name | Description |
transport |
com.google.api.client.http.HttpTransport HTTP transport |
jsonFactory |
com.google.api.client.json.JsonFactory JSON factory |
Methods
executeRefreshToken()
protected TokenResponse executeRefreshToken()
Returns | |
---|---|
Type | Description |
com.google.api.client.auth.oauth2.TokenResponse |
com.google.api.client.auth.oauth2.Credential.executeRefreshToken()
Exceptions | |
---|---|
Type | Description |
IOException |