Class AwsCredentials (1.4.0)

public class AwsCredentials extends ExternalAccountCredentials

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

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

Static Methods

newBuilder()

public static AwsCredentials.Builder newBuilder()
Returns
TypeDescription
AwsCredentials.Builder

newBuilder(AwsCredentials awsCredentials)

public static AwsCredentials.Builder newBuilder(AwsCredentials awsCredentials)
Parameter
NameDescription
awsCredentialsAwsCredentials
Returns
TypeDescription
AwsCredentials.Builder

Methods

createScoped(Collection<String> newScopes)

public GoogleCredentials createScoped(Collection<String> newScopes)

Clones the AwsCredentials with the specified scopes.

Parameter
NameDescription
newScopesCollection<String>
Returns
TypeDescription
GoogleCredentials
Overrides

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
TypeDescription
AccessToken
Overrides Exceptions
TypeDescription
IOException

retrieveSubjectToken()

public String retrieveSubjectToken()

Retrieves the external subject token to be exchanged for a GCP access token.

Must be implemented by subclasses as the retrieval method is dependent on the credential source.

Returns
TypeDescription
String
Overrides Exceptions
TypeDescription
IOException