@ThreadSafe public class StsGetSessionTokenCredentialsProvider extends Object
AwsCredentialsProvider that periodically sends a GetSessionTokenRequest to the AWS
Security Token Service to maintain short-lived sessions to use for authentication. These sessions are updated asynchronously
in the background as they get close to expiring. If the credentials are not successfully updated asynchronously in the
background, calls to resolveCredentials() will begin to block in an attempt to update the credentials synchronously.
This provider creates a thread in the background to periodically update credentials. If this provider is no longer needed,
the background thread can be shut down using close().
This is created using builder().| Modifier and Type | Class and Description |
|---|---|
protected static class |
StsCredentialsProvider.BaseBuilder<B extends StsCredentialsProvider.BaseBuilder<B,T>,T>
Extended by child class's builders to share configuration across credential providers.
|
static class |
StsGetSessionTokenCredentialsProvider.Builder
A builder (created by
builder()) for creating a
StsGetSessionTokenCredentialsProvider. |
| Modifier and Type | Method and Description |
|---|---|
static StsGetSessionTokenCredentialsProvider.Builder |
builder()
Create a builder for an
StsGetSessionTokenCredentialsProvider. |
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.
|
AwsCredentials |
resolveCredentials() |
String |
toString() |
public static StsGetSessionTokenCredentialsProvider.Builder builder()
StsGetSessionTokenCredentialsProvider.protected Credentials getUpdatedCredentials(StsClient stsClient)
public AwsCredentials resolveCredentials()
resolveCredentials in interface AwsCredentialsProviderpublic void close()
close in interface AutoCloseableclose in interface SdkAutoCloseableCopyright © 2020. All rights reserved.