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 |
OAuth2Credentials.CredentialsChangedListener
impersonatedCredentials, transportFactory
quotaProjectId
Modifier and Type | Method and Description |
---|---|
GoogleCredentials |
createScoped(Collection<String> newScopes)
Clones the AwsCredentials with the specified scopes.
|
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.
|
exchangeExternalCredentialForAccessToken, fromStream, fromStream, getAudience, getClientId, getClientSecret, getCredentialSource, getRequestMetadata, getRequestMetadata, getScopes, getServiceAccountEmail, getServiceAccountImpersonationOptions, getServiceAccountImpersonationUrl, getSubjectTokenType, getTokenInfoUrl, getTokenUrl, getWorkforcePoolUserProject, isWorkforcePoolConfiguration
create, createDelegated, createScoped, createScoped, createScopedRequired, createWithCustomRetryStrategy, createWithQuotaProject, getAdditionalHeaders, getApplicationDefault, getApplicationDefault, getQuotaProjectId, toBuilder
addChangeListener, equals, getAccessToken, getAuthenticationType, getFromServiceLoader, getRequestMetadataInternal, hashCode, hasRequestMetadata, hasRequestMetadataOnly, newInstance, refresh, refreshIfExpired, removeChangeListener, toString
blockingGetToCallback, getRequestMetadata
public AccessToken refreshAccessToken() throws IOException
OAuth2Credentials
Throws IllegalStateException if not overridden since direct use of OAuth2Credentials is only for temporary or non-refreshing access tokens.
refreshAccessToken
in class OAuth2Credentials
IOException
public String retrieveSubjectToken() throws IOException
ExternalAccountCredentials
Must be implemented by subclasses as the retrieval method is dependent on the credential source.
retrieveSubjectToken
in class ExternalAccountCredentials
IOException
- if the subject token cannot be retrievedpublic GoogleCredentials createScoped(Collection<String> newScopes)
createScoped
in class GoogleCredentials
newScopes
- Collection of scopes to request.public static AwsCredentials.Builder newBuilder()
public static AwsCredentials.Builder newBuilder(AwsCredentials awsCredentials)
Copyright © 2023 Google. All rights reserved.