Interface IdentityProviders
- All Superinterfaces:
ToCopyableBuilder<IdentityProviders.Builder,IdentityProviders>
- All Known Implementing Classes:
DefaultIdentityProviders
IdentityProvider based on the identity type.
IdentityProviders is a registry that maps identity types to their corresponding identity providers.
It is used by AuthSchemes to retrieve the appropriate
identity provider for resolving authentication identities.
How It Works
When an auth scheme needs to resolve an identity, it calls identityProvider(Class) with the identity
type it requires (e.g., AwsCredentialsIdentity.class). The registry returns the corresponding provider
that was configured on the client.
Default Configuration
The SDK automatically configures identity providers based on the client configuration:
- When you set
credentialsProvider()on the client builder, it registers anAwsCredentialsIdentityprovider - When you set
tokenProvider()on the client builder, it registers aTokenIdentityprovider
Usage in Auth Schemes
Auth schemes use IdentityProviders to retrieve the appropriate identity provider for their
identity type.
Example - Auth scheme using IdentityProviders:
public class CustomAuthScheme implements AwsV4AuthScheme {
@Override
public String schemeId() {
return AwsV4AuthScheme.SCHEME_ID;
}
@Override
public IdentityProvider<AwsCredentialsIdentity> identityProvider(IdentityProviders providers) {
// Retrieve the AWS credentials provider from the registry
return providers.identityProvider(AwsCredentialsIdentity.class);
}
@Override
public AwsV4HttpSigner signer() {
return new CustomSigV4Signer();
}
}
Standard Identity Types
The SDK provides standard identity types:
AwsCredentialsIdentity- AWS access key credentialsTokenIdentity- Bearer tokensAwsSessionCredentialsIdentity- AWS credentials with session token
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic IdentityProviders.Builderbuilder()Get a new builder for creating aIdentityProviders.<T extends Identity>
IdentityProvider<T> identityProvider(Class<T> identityType) Retrieve an identity provider for the provided identity type.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy, toBuilder
-
Method Details
-
identityProvider
Retrieve an identity provider for the provided identity type. -
builder
Get a new builder for creating aIdentityProviders.
-