Class WebIdentityTokenFileCredentialsProvider
- java.lang.Object
-
- software.amazon.awssdk.auth.credentials.WebIdentityTokenFileCredentialsProvider
-
- All Implemented Interfaces:
AutoCloseable
,AwsCredentialsProvider
,IdentityProvider<AwsCredentialsIdentity>
,ToCopyableBuilder<WebIdentityTokenFileCredentialsProvider.Builder,WebIdentityTokenFileCredentialsProvider>
,SdkAutoCloseable
public class WebIdentityTokenFileCredentialsProvider extends Object implements AwsCredentialsProvider, SdkAutoCloseable, ToCopyableBuilder<WebIdentityTokenFileCredentialsProvider.Builder,WebIdentityTokenFileCredentialsProvider>
A credential provider that will read web identity token file path, aws role arn and aws session name from system properties or environment variables for using web identity token credentials with STS.Use of this credentials provider requires the 'sts' module to be on the classpath.
StsWebIdentityTokenFileCredentialsProvider in sts package can be used instead of this class if any one of following is required
- Pass a custom StsClient to the provider.
- Periodically update credentials
- See Also:
AwsCredentialsProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
WebIdentityTokenFileCredentialsProvider.Builder
A builder for creating a customWebIdentityTokenFileCredentialsProvider
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WebIdentityTokenFileCredentialsProvider.Builder
builder()
void
close()
static WebIdentityTokenFileCredentialsProvider
create()
AwsCredentials
resolveCredentials()
ReturnsAwsCredentials
that can be used to authorize an AWS request.WebIdentityTokenFileCredentialsProvider.Builder
toBuilder()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
create
public static WebIdentityTokenFileCredentialsProvider create()
-
resolveCredentials
public AwsCredentials resolveCredentials()
Description copied from interface:AwsCredentialsProvider
ReturnsAwsCredentials
that can be used to authorize an AWS request. Each implementation of AWSCredentialsProvider can choose 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.
- Specified by:
resolveCredentials
in interfaceAwsCredentialsProvider
- Returns:
- AwsCredentials which the caller can use to authorize an AWS request.
-
builder
public static WebIdentityTokenFileCredentialsProvider.Builder builder()
-
toBuilder
public WebIdentityTokenFileCredentialsProvider.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<WebIdentityTokenFileCredentialsProvider.Builder,WebIdentityTokenFileCredentialsProvider>
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSdkAutoCloseable
-
-