Interface IdentityProviders

  • All Superinterfaces:
    ToCopyableBuilder<IdentityProviders.Builder,​IdentityProviders>
    All Known Implementing Classes:
    DefaultIdentityProviders

    @SdkPublicApi
    public interface IdentityProviders
    extends ToCopyableBuilder<IdentityProviders.Builder,​IdentityProviders>
    An interface to allow retrieving an IdentityProvider based on the identity type.

    IdentityProviders is a registry that maps identity types to their corresponding identity providers. It is used by software.amazon.awssdk.http.auth.spi.scheme.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 an AwsCredentialsIdentity provider
    • When you set tokenProvider() on the client builder, it registers a TokenIdentity provider

    Usage in Auth Schemes

    Auth schemes use IdentityProviders to retrieve the appropriate identity provider for their identity type.

    Example - Auth scheme using IdentityProviders: {@snippet : public class CustomAuthScheme implements AwsV4AuthScheme {

    See Also:
    IdentityProvider, Identity, software.amazon.awssdk.http.auth.spi.scheme.AuthScheme