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.CredentialsChangedListenerimpersonatedCredentials, transportFactory| 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, getQuotaProjectId, getRequestMetadata, getRequestMetadata, getScopes, getServiceAccountImpersonationUrl, getSubjectTokenType, getTokenInfoUrl, getTokenUrl, getWorkforcePoolUserProject, isWorkforcePoolConfigurationcreate, createDelegated, createScoped, createScoped, createScopedRequired, createWithCustomRetryStrategy, getApplicationDefault, getApplicationDefault, toBuilderaddChangeListener, equals, getAccessToken, getAdditionalHeaders, getAuthenticationType, getFromServiceLoader, getRequestMetadataInternal, hashCode, hasRequestMetadata, hasRequestMetadataOnly, newInstance, refresh, refreshIfExpired, removeChangeListener, toStringblockingGetToCallback, getRequestMetadatapublic AccessToken refreshAccessToken() throws IOException
OAuth2CredentialsThrows IllegalStateException if not overridden since direct use of OAuth2Credentials is only for temporary or non-refreshing access tokens.
refreshAccessToken in class OAuth2CredentialsIOExceptionpublic String retrieveSubjectToken() throws IOException
ExternalAccountCredentialsMust be implemented by subclasses as the retrieval method is dependent on the credential source.
retrieveSubjectToken in class ExternalAccountCredentialsIOExceptionpublic GoogleCredentials createScoped(Collection<String> newScopes)
createScoped in class GoogleCredentialsnewScopes - Collection of scopes to request.public static AwsCredentials.Builder newBuilder()
public static AwsCredentials.Builder newBuilder(AwsCredentials awsCredentials)
Copyright © 2022 Google. All rights reserved.