@Beta
public class ComputeCredential
extends com.google.api.client.auth.oauth2.Credential
Beta Sample usage:
public static HttpRequestFactory createRequestFactory(
HttpTransport transport, JsonFactory jsonFactory) {
return transport.createRequestFactory(
new GoogleComputeCredential(transport, jsonFactory));
}
Implementation is immutable and thread-safe.
| Modifier and Type | Class and Description |
|---|---|
static class |
ComputeCredential.Builder
Beta Google Compute Engine credential builder. |
| Modifier and Type | Field and Description |
|---|---|
static String |
TOKEN_SERVER_ENCODED_URL
Metadata Service Account token server encoded URL.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ComputeCredential(ComputeCredential.Builder builder) |
|
ComputeCredential(com.google.api.client.http.HttpTransport transport,
com.google.api.client.json.JsonFactory jsonFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected com.google.api.client.auth.oauth2.TokenResponse |
executeRefreshToken() |
getAccessToken, getClientAuthentication, getClock, getExpirationTimeMilliseconds, getExpiresInSeconds, getJsonFactory, getMethod, getRefreshListeners, getRefreshToken, getRequestInitializer, getTokenServerEncodedUrl, getTransport, handleResponse, initialize, intercept, refreshToken, setAccessToken, setExpirationTimeMilliseconds, setExpiresInSeconds, setFromTokenResponse, setRefreshTokenpublic static final String TOKEN_SERVER_ENCODED_URL
public ComputeCredential(com.google.api.client.http.HttpTransport transport,
com.google.api.client.json.JsonFactory jsonFactory)
transport - HTTP transportjsonFactory - JSON factoryprotected ComputeCredential(ComputeCredential.Builder builder)
builder - builderprotected com.google.api.client.auth.oauth2.TokenResponse executeRefreshToken()
throws IOException
executeRefreshToken in class com.google.api.client.auth.oauth2.CredentialIOExceptionCopyright © 2010–2025 Google. All rights reserved.