Class StsWebIdentityTokenFileCredentialsProvider
java.lang.Object
software.amazon.awssdk.services.sts.auth.StsCredentialsProvider
software.amazon.awssdk.services.sts.auth.StsWebIdentityTokenFileCredentialsProvider
- All Implemented Interfaces:
AutoCloseable,AwsCredentialsProvider,IdentityProvider<AwsCredentialsIdentity>,ToCopyableBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,,StsWebIdentityTokenFileCredentialsProvider> SdkAutoCloseable
public final class StsWebIdentityTokenFileCredentialsProvider
extends StsCredentialsProvider
implements ToCopyableBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,StsWebIdentityTokenFileCredentialsProvider>
An implementation of
AwsCredentialsProvider that periodically sends an AssumeRoleWithWebIdentityRequest to the
AWS Security Token Service to maintain short-lived sessions to use for authentication. These sessions are updated using a
single calling thread (by default) or asynchronously (if StsCredentialsProvider.BaseBuilder.asyncCredentialUpdateEnabled(Boolean) is set).
Unlike StsAssumeRoleWithWebIdentityCredentialsProvider, this reads the web identity information, including AWS role
ARN, AWS session name and the location of a web identity token file from system properties and environment variables. The
web identity token file is expected to contain the web identity token to use with each request.
If the credentials are not successfully updated before expiration, calls to resolveCredentials() will block until
they are updated successfully.
Users of this provider must StsCredentialsProvider.close() it when they are finished using it.
This is created using builder().-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classNested classes/interfaces inherited from class software.amazon.awssdk.services.sts.auth.StsCredentialsProvider
StsCredentialsProvider.BaseBuilder<B extends StsCredentialsProvider.BaseBuilder<B,T>, T extends ToCopyableBuilder<B, T>> -
Method Summary
Modifier and TypeMethodDescriptionbuilder()ReturnsAwsCredentialsthat can be used to authorize an AWS request.Take this object and create a builder that contains all of the current property values of this object.Methods inherited from class software.amazon.awssdk.services.sts.auth.StsCredentialsProvider
close, prefetchTime, staleTime, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awssdk.auth.credentials.AwsCredentialsProvider
identityType, resolveIdentityMethods inherited from interface software.amazon.awssdk.identity.spi.IdentityProvider
resolveIdentity, resolveIdentityMethods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
builder
-
resolveCredentials
Description copied from interface:AwsCredentialsProviderReturnsAwsCredentialsthat can be used to authorize an AWS request. Each implementation of AWSCredentialsProvider can choose its own strategy for loading credentials. For example, an implementation might load credentials from an existing key management system, or load new credentials when credentials are rotated.If an error occurs during the loading of credentials or credentials could not be found, a runtime exception will be raised.
- Specified by:
resolveCredentialsin interfaceAwsCredentialsProvider- Overrides:
resolveCredentialsin classStsCredentialsProvider- Returns:
- AwsCredentials which the caller can use to authorize an AWS request.
-
toBuilder
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,StsWebIdentityTokenFileCredentialsProvider> - Returns:
- a builder for type T
-