Class StsCredentialsProvider
- java.lang.Object
-
- software.amazon.awssdk.services.sts.auth.StsCredentialsProvider
-
- All Implemented Interfaces:
AutoCloseable
,AwsCredentialsProvider
,IdentityProvider<AwsCredentialsIdentity>
,SdkAutoCloseable
- Direct Known Subclasses:
StsAssumeRoleCredentialsProvider
,StsAssumeRoleWithSamlCredentialsProvider
,StsAssumeRoleWithWebIdentityCredentialsProvider
,StsGetFederationTokenCredentialsProvider
,StsGetSessionTokenCredentialsProvider
,StsWebIdentityTokenFileCredentialsProvider
@ThreadSafe public abstract class StsCredentialsProvider extends Object implements AwsCredentialsProvider, SdkAutoCloseable
An implementation ofAwsCredentialsProvider
that is extended within this package to provide support for periodically- updating session credentials. When credentials get close to expiration, this class will attempt to update them automatically either with a single calling thread (by default) or asynchronously (ifasyncCredentialUpdateEnabled
is true). If the credentials expire, this class will block all calls toresolveCredentials()
until the credentials are updated. Users of this provider mustclose()
it when they are finished using it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StsCredentialsProvider.BaseBuilder<B extends StsCredentialsProvider.BaseBuilder<B,T>,T extends ToCopyableBuilder<B,T>>
Extended by child class's builders to share configuration across credential providers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Duration
prefetchTime()
The amount of time, relative to STS token expiration, that the cached credentials are considered close to stale and should be updated.AwsCredentials
resolveCredentials()
Duration
staleTime()
The amount of time, relative to STS token expiration, that the cached credentials are considered stale and should no longer be used.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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
-
-
-
-
Method Detail
-
resolveCredentials
public AwsCredentials resolveCredentials()
- Specified by:
resolveCredentials
in interfaceAwsCredentialsProvider
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSdkAutoCloseable
-
staleTime
public Duration staleTime()
The amount of time, relative to STS token expiration, that the cached credentials are considered stale and should no longer be used. All threads will block until the value is updated.
-
prefetchTime
public Duration prefetchTime()
The amount of time, relative to STS token expiration, that the cached credentials are considered close to stale and should be updated.
-
-