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 |
OAuth2Credentials.CredentialsChangedListener
impersonatedCredentials, transportFactory
quotaProjectId
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.
|
exchangeExternalCredentialForAccessToken, fromStream, fromStream, getAudience, getClientId, getClientSecret, getCredentialSource, getRequestMetadata, getRequestMetadata, getScopes, getServiceAccountEmail, getServiceAccountImpersonationOptions, getServiceAccountImpersonationUrl, getSubjectTokenType, getTokenInfoUrl, getTokenUrl, getWorkforcePoolUserProject, isWorkforcePoolConfiguration
create, createDelegated, createScoped, createScoped, createScopedRequired, createWithCustomRetryStrategy, createWithQuotaProject, getAdditionalHeaders, getApplicationDefault, getApplicationDefault, getQuotaProjectId, toBuilder
addChangeListener, equals, getAccessToken, getAuthenticationType, getFromServiceLoader, getRequestMetadataInternal, hashCode, hasRequestMetadata, hasRequestMetadataOnly, newInstance, refresh, refreshIfExpired, removeChangeListener, toString
blockingGetToCallback, getRequestMetadata
public AccessToken refreshAccessToken() throws IOException
OAuth2Credentials
Throws IllegalStateException if not overridden since direct use of OAuth2Credentials is only for temporary or non-refreshing access tokens.
refreshAccessToken
in class OAuth2Credentials
IOException
public String retrieveSubjectToken() throws IOException
ExternalAccountCredentials
Must be implemented by subclasses as the retrieval method is dependent on the credential source.
retrieveSubjectToken
in class ExternalAccountCredentials
IOException
- if the subject token cannot be retrievedpublic IdentityPoolCredentials createScoped(Collection<String> newScopes)
createScoped
in class GoogleCredentials
newScopes
- Collection of scopes to request.public static IdentityPoolCredentials.Builder newBuilder()
public static IdentityPoolCredentials.Builder newBuilder(IdentityPoolCredentials identityPoolCredentials)
Copyright © 2023 Google. All rights reserved.