public class IdentityPoolCredentials extends ExternalAccountCredentials
By default, attempts to exchange the external credential for a GCP access token.
| Modifier and Type | Class and Description |
|---|---|
static class |
IdentityPoolCredentials.Builder |
ExternalAccountCredentials.SubjectTokenTypesOAuth2Credentials.CredentialsChangedListenerimpersonatedCredentials, transportFactoryquotaProjectIdGOOGLE_DEFAULT_UNIVERSE| Modifier and Type | Method and Description |
|---|---|
IdentityPoolCredentials |
createScoped(Collection<String> newScopes)
Clones the IdentityPoolCredentials with the specified scopes.
|
static IdentityPoolCredentials.Builder |
newBuilder() |
static IdentityPoolCredentials.Builder |
newBuilder(IdentityPoolCredentials identityPoolCredentials) |
AccessToken |
refreshAccessToken()
Method to refresh the access token according to the specific type of credentials.
|
String |
retrieveSubjectToken()
Retrieves the external subject token to be exchanged for a Google Cloud access token.
|
IdentityPoolCredentials.Builder |
toBuilder() |
exchangeExternalCredentialForAccessToken, fromStream, fromStream, getAudience, getClientId, getClientSecret, getCredentialSource, getRequestMetadata, getRequestMetadata, getScopes, getServiceAccountEmail, getServiceAccountImpersonationOptions, getServiceAccountImpersonationUrl, getSubjectTokenType, getTokenInfoUrl, getTokenUrl, getUniverseDomain, getWorkforcePoolUserProject, isWorkforcePoolConfigurationcreate, create, createDelegated, createScoped, createScoped, createScopedRequired, createWithCustomRetryStrategy, createWithQuotaProject, equals, getAdditionalHeaders, getApplicationDefault, getApplicationDefault, getCredentialInfo, getQuotaProjectId, hashCode, isExplicitUniverseDomain, toString, toStringHelperaddChangeListener, getAccessToken, getAuthenticationType, getFromServiceLoader, getRequestMetadataInternal, hasRequestMetadata, hasRequestMetadataOnly, newInstance, refresh, refreshIfExpired, removeChangeListenerblockingGetToCallback, getMetricsCredentialType, getRequestMetadatapublic AccessToken refreshAccessToken() throws IOException
OAuth2CredentialsThrows IllegalStateException if not overridden since direct use of OAuth2Credentials is only for temporary or non-refreshing access tokens.
refreshAccessToken in class OAuth2CredentialsIOExceptionpublic String retrieveSubjectToken() throws IOException
ExternalAccountCredentialsMust be implemented by subclasses as the retrieval method is dependent on the credential source.
retrieveSubjectToken in class ExternalAccountCredentialsIOException - if the subject token cannot be retrievedpublic IdentityPoolCredentials createScoped(Collection<String> newScopes)
createScoped in class GoogleCredentialsnewScopes - Collection of scopes to request.public static IdentityPoolCredentials.Builder newBuilder()
public static IdentityPoolCredentials.Builder newBuilder(IdentityPoolCredentials identityPoolCredentials)
public IdentityPoolCredentials.Builder toBuilder()
toBuilder in class GoogleCredentialsCopyright © 2025 Google. All rights reserved.