public class AwsCredentials extends ExternalAccountCredentials
By default, attempts to exchange the external credential for a GCP access token.
| Modifier and Type | Class and Description |
|---|---|
static class |
AwsCredentials.Builder |
ExternalAccountCredentials.SubjectTokenTypesOAuth2Credentials.CredentialsChangedListenerimpersonatedCredentials, transportFactoryquotaProjectIdGOOGLE_DEFAULT_UNIVERSE| Modifier and Type | Method and Description |
|---|---|
GoogleCredentials |
createScoped(Collection<String> newScopes)
Clones the AwsCredentials with the specified scopes.
|
String |
getRegionalCredentialVerificationUrlOverride() |
static AwsCredentials.Builder |
newBuilder() |
static AwsCredentials.Builder |
newBuilder(AwsCredentials awsCredentials) |
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.
|
AwsCredentials.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 GoogleCredentials createScoped(Collection<String> newScopes)
createScoped in class GoogleCredentialsnewScopes - Collection of scopes to request.@Nullable public String getRegionalCredentialVerificationUrlOverride()
public static AwsCredentials.Builder newBuilder()
public static AwsCredentials.Builder newBuilder(AwsCredentials awsCredentials)
public AwsCredentials.Builder toBuilder()
toBuilder in class GoogleCredentialsCopyright © 2025 Google. All rights reserved.