@ThreadSafe public class StsAssumeRoleCredentialsProvider extends Object
AwsCredentialsProvider
that periodically sends an AssumeRoleRequest
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 |
---|---|
static class |
StsAssumeRoleCredentialsProvider.Builder
A builder (created by
builder() ) for creating a
StsAssumeRoleCredentialsProvider . |
Modifier and Type | Method and Description |
---|---|
static StsAssumeRoleCredentialsProvider.Builder |
builder()
Create a builder for an
StsAssumeRoleCredentialsProvider . |
void |
close() |
AwsCredentials |
resolveCredentials()
Returns
AwsCredentials that can be used to authorize an AWS request. |
String |
toString() |
public static StsAssumeRoleCredentialsProvider.Builder builder()
StsAssumeRoleCredentialsProvider
.public AwsCredentials resolveCredentials()
AwsCredentialsProvider
AwsCredentials
that can be used to authorize an AWS request. Each implementation of AWSCredentialsProvider
can chose 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.
resolveCredentials
in interface AwsCredentialsProvider
public void close()
SdkAutoCloseable
close
in interface AutoCloseable
close
in interface SdkAutoCloseable
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.