public class ComputeCredential extends CredentialBeta
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.
Static Fields
TOKEN_SERVER_ENCODED_URL
public static final String TOKEN_SERVER_ENCODED_URLMetadata 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.Builderbuilder |
ComputeCredential(HttpTransport transport, JsonFactory jsonFactory)
public ComputeCredential(HttpTransport transport, JsonFactory jsonFactory)| Parameters | |
|---|---|
| Name | Description |
transport |
com.google.api.client.http.HttpTransportHTTP transport |
jsonFactory |
com.google.api.client.json.JsonFactoryJSON 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 |
|