@ThreadSafe public class StsAssumeRoleWithWebIdentityCredentialsProvider extends Object
AwsCredentialsProvider
that periodically sends a AssumeRoleWithWebIdentityRequest
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 |
StsAssumeRoleWithWebIdentityCredentialsProvider.Builder
A builder (created by
builder() ) for creating a
StsAssumeRoleWithWebIdentityCredentialsProvider . |
Modifier and Type | Method and Description |
---|---|
static StsAssumeRoleWithWebIdentityCredentialsProvider.Builder |
builder()
Create a builder for an
StsAssumeRoleWithWebIdentityCredentialsProvider . |
void |
close() |
AwsCredentials |
resolveCredentials()
Returns
AwsCredentials that can be used to authorize an AWS request. |
String |
toString() |
public static StsAssumeRoleWithWebIdentityCredentialsProvider.Builder builder()
StsAssumeRoleWithWebIdentityCredentialsProvider
.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.