@ThreadSafe public final class StsAssumeRoleWithWebIdentityCredentialsProvider extends Object implements ToCopyableBuilder<StsAssumeRoleWithWebIdentityCredentialsProvider.Builder,StsAssumeRoleWithWebIdentityCredentialsProvider>
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).
If the credentials are not successfully updated before expiration, calls to resolveCredentials()
will block until
they are updated successfully.
Users of this provider must close()
it when they are finished using it.
This is created using builder()
.Modifier and Type | Class and Description |
---|---|
static class |
StsAssumeRoleWithWebIdentityCredentialsProvider.Builder
A builder (created by
builder() ) for creating a
StsAssumeRoleWithWebIdentityCredentialsProvider . |
protected 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.
|
Modifier and Type | Method and Description |
---|---|
static StsAssumeRoleWithWebIdentityCredentialsProvider.Builder |
builder()
Create a builder for an
StsAssumeRoleWithWebIdentityCredentialsProvider . |
void |
close() |
protected Credentials |
getUpdatedCredentials(StsClient stsClient)
Implemented by a child class to call STS and get a new set of credentials to be used by this provider.
|
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.
|
StsAssumeRoleWithWebIdentityCredentialsProvider.Builder |
toBuilder() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
copy
public static StsAssumeRoleWithWebIdentityCredentialsProvider.Builder builder()
StsAssumeRoleWithWebIdentityCredentialsProvider
.protected Credentials getUpdatedCredentials(StsClient stsClient)
public StsAssumeRoleWithWebIdentityCredentialsProvider.Builder toBuilder()
public AwsCredentials resolveCredentials()
resolveCredentials
in interface AwsCredentialsProvider
public void close()
close
in interface AutoCloseable
close
in interface SdkAutoCloseable
public Duration staleTime()
public Duration prefetchTime()
Copyright © 2022. All rights reserved.