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 class
Nested 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()
ReturnsAwsCredentials
that 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, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awssdk.auth.credentials.AwsCredentialsProvider
identityType, resolveIdentity
Methods inherited from interface software.amazon.awssdk.identity.spi.IdentityProvider
resolveIdentity, resolveIdentity
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
builder
-
resolveCredentials
Description copied from interface:AwsCredentialsProvider
ReturnsAwsCredentials
that 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:
resolveCredentials
in interfaceAwsCredentialsProvider
- Overrides:
resolveCredentials
in classStsCredentialsProvider
- Returns:
- AwsCredentials which the caller can use to authorize an AWS request.
-
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,
StsWebIdentityTokenFileCredentialsProvider> - Returns:
- a builder for type T
-