Package com.google.auth.oauth2
Class AwsCredentials
java.lang.Object
com.google.auth.Credentials
com.google.auth.oauth2.OAuth2Credentials
com.google.auth.oauth2.GoogleCredentials
com.google.auth.oauth2.ExternalAccountCredentials
com.google.auth.oauth2.AwsCredentials
- All Implemented Interfaces:
QuotaProjectIdProvider,Serializable
Credentials representing an AWS third-party identity for calling Google APIs. AWS security
credentials are either sourced by calling EC2 metadata endpoints, environment variables, or a
user provided supplier method.
By default, attempts to exchange the external credential for a GCP access token.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.google.auth.oauth2.ExternalAccountCredentials
ExternalAccountCredentials.SubjectTokenTypesNested classes/interfaces inherited from class com.google.auth.oauth2.OAuth2Credentials
OAuth2Credentials.CredentialsChangedListener -
Field Summary
Fields inherited from class com.google.auth.oauth2.ExternalAccountCredentials
impersonatedCredentials, transportFactoryFields inherited from class com.google.auth.oauth2.GoogleCredentials
quotaProjectIdFields inherited from class com.google.auth.Credentials
GOOGLE_DEFAULT_UNIVERSE -
Method Summary
Modifier and TypeMethodDescriptioncreateScoped(Collection<String> newScopes) Clones the AwsCredentials with the specified scopes.static AwsCredentials.Builderstatic AwsCredentials.BuildernewBuilder(AwsCredentials awsCredentials) Method to refresh the access token according to the specific type of credentials.Retrieves the external subject token to be exchanged for a Google Cloud access token.Methods inherited from class com.google.auth.oauth2.ExternalAccountCredentials
exchangeExternalCredentialForAccessToken, fromStream, fromStream, getAudience, getClientId, getClientSecret, getCredentialSource, getRequestMetadata, getRequestMetadata, getScopes, getServiceAccountEmail, getServiceAccountImpersonationOptions, getServiceAccountImpersonationUrl, getSubjectTokenType, getTokenInfoUrl, getTokenUrl, getUniverseDomain, getWorkforcePoolUserProject, isWorkforcePoolConfigurationMethods inherited from class com.google.auth.oauth2.GoogleCredentials
create, create, createDelegated, createScoped, createScoped, createScopedRequired, createWithCustomRetryStrategy, createWithQuotaProject, equals, getAdditionalHeaders, getApplicationDefault, getApplicationDefault, getCredentialInfo, getProjectId, getQuotaProjectId, hashCode, isExplicitUniverseDomain, toString, toStringHelperMethods inherited from class com.google.auth.oauth2.OAuth2Credentials
addChangeListener, getAccessToken, getAuthenticationType, getFromServiceLoader, getRequestMetadataInternal, hasRequestMetadata, hasRequestMetadataOnly, newInstance, refresh, refreshIfExpired, removeChangeListenerMethods inherited from class com.google.auth.Credentials
blockingGetToCallback, getMetricsCredentialType, getRequestMetadata
-
Method Details
-
refreshAccessToken
Description copied from class:OAuth2CredentialsMethod to refresh the access token according to the specific type of credentials.Throws IllegalStateException if not overridden since direct use of OAuth2Credentials is only for temporary or non-refreshing access tokens.
- Overrides:
refreshAccessTokenin classOAuth2Credentials- Returns:
- never
- Throws:
IOException
-
retrieveSubjectToken
Description copied from class:ExternalAccountCredentialsRetrieves the external subject token to be exchanged for a Google Cloud access token.Must be implemented by subclasses as the retrieval method is dependent on the credential source.
- Specified by:
retrieveSubjectTokenin classExternalAccountCredentials- Returns:
- the external subject token
- Throws:
IOException- if the subject token cannot be retrieved
-
createScoped
Clones the AwsCredentials with the specified scopes.- Overrides:
createScopedin classGoogleCredentials- Parameters:
newScopes- Collection of scopes to request.- Returns:
- GoogleCredentials with requested scopes.
-
getRegionalCredentialVerificationUrlOverride
-
newBuilder
-
newBuilder
-
toBuilder
- Overrides:
toBuilderin classGoogleCredentials
-