Interface IdentityProvider<IdentityT extends Identity>
Identity that is used for authentication.
Identity providers are responsible for resolving credentials, tokens, or other authentication identities
that are used by signers to authenticate requests. The SDK provides built-in identity providers for common
identity types like AwsCredentialsIdentity and TokenIdentity.
Common Built-in Identity Providers
DefaultCredentialsProvider- Resolves AWS credentials from the default credential chainStaticCredentialsProvider- Provides static AWS credentialsProfileCredentialsProvider- Resolves credentials from AWS profilesStsAssumeRoleCredentialsProvider- Assumes an IAM role using STS
How Identity Providers Work
Identity providers are selected by software.amazon.awssdk.http.auth.spi.scheme.AuthSchemes based on the
identity type they produce. The SDK matches the identity type required by the auth scheme with the appropriate
provider from IdentityProviders.
Implementing a Custom Identity Provider
You can implement custom identity providers for specialized authentication scenarios, such as retrieving credentials from a custom credential store or implementing a custom token provider.
Example - Custom credentials provider:
Using Identity Properties
Identity providers can read IdentityProperty values from the ResolveIdentityRequest to
customize identity resolution based on request-specific parameters.
Example - Identity provider using properties:
- See Also:
-
IdentityIdentityProvidersIdentityPropertysoftware.amazon.awssdk.http.auth.spi.scheme.AuthScheme
-
Method Summary
Modifier and TypeMethodDescriptionRetrieve the class of identity this identity provider produces.default CompletableFuture<? extends IdentityT>Resolve the identity from this identity provider.default CompletableFuture<? extends IdentityT>Resolve the identity from this identity provider.CompletableFuture<? extends IdentityT>resolveIdentity(ResolveIdentityRequest request) Resolve the identity from this identity provider.
-
Method Details
-
identityType
Retrieve the class of identity this identity provider produces. This is necessary for the SDK core to determine which identity provider should be used to resolve a specific type of identity. -
resolveIdentity
Resolve the identity from this identity provider.- Parameters:
request- The request to resolve an Identity
-
resolveIdentity
default CompletableFuture<? extends IdentityT> resolveIdentity(Consumer<ResolveIdentityRequest.Builder> consumer) Resolve the identity from this identity provider. Similar toresolveIdentity(ResolveIdentityRequest), but takes a lambda to configure a newResolveIdentityRequest.Builder. This removes the need to callResolveIdentityRequest.builder()andSdkBuilder.build().- Parameters:
consumer- AConsumerto which an emptyResolveIdentityRequest.Builderwill be given.
-
resolveIdentity
Resolve the identity from this identity provider.
-