Class AwsCredentials (1.25.0)

public class AwsCredentials extends ExternalAccountCredentials

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.

Static Methods

newBuilder()

public static AwsCredentials.Builder newBuilder()
Returns
Type Description
AwsCredentials.Builder

newBuilder(AwsCredentials awsCredentials)

public static AwsCredentials.Builder newBuilder(AwsCredentials awsCredentials)
Parameter
Name Description
awsCredentials AwsCredentials
Returns
Type Description
AwsCredentials.Builder

Methods

createScoped(Collection<String> newScopes)

public GoogleCredentials createScoped(Collection<String> newScopes)

Clones the AwsCredentials with the specified scopes.

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

getRegionalCredentialVerificationUrlOverride()

public String getRegionalCredentialVerificationUrlOverride()
Returns
Type Description
String

refreshAccessToken()

public AccessToken refreshAccessToken()

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()

public String retrieveSubjectToken()

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