Class AwsCredentials (1.19.0)

publicclass AwsCredentialsextendsExternalAccountCredentials

AWS credentials representing a third-party identity for calling Google APIs.

By default, attempts to exchange the external credential for a GCP access token.

Inherited Members

Static Methods

newBuilder()

publicstaticAwsCredentials.BuildernewBuilder()
Returns
Type Description
AwsCredentials.Builder

newBuilder(AwsCredentials awsCredentials)

publicstaticAwsCredentials.BuildernewBuilder(AwsCredentialsawsCredentials)
Parameter
Name Description
awsCredentials AwsCredentials
Returns
Type Description
AwsCredentials.Builder

Methods

createScoped(Collection<String> newScopes)

publicGoogleCredentialscreateScoped(Collection<String>newScopes)

Clones the AwsCredentials with the specified scopes.

Parameter
Name Description
newScopes Collection<String>
Returns
Type Description
GoogleCredentials
Overrides

refreshAccessToken()

publicAccessTokenrefreshAccessToken()

Method 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.

Returns
Type Description
AccessToken
Overrides
Exceptions
Type Description
IOException

retrieveSubjectToken()

publicStringretrieveSubjectToken()

Retrieves 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.

Returns
Type Description
String
Overrides
Exceptions
Type Description
IOException

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.