Interface HttpSigner<IdentityT extends Identity>

Type Parameters:
IdentityT - The type of the identity.
All Known Subinterfaces:
AwsV4aHttpSigner, AwsV4FamilyHttpSigner<T>, AwsV4HttpSigner, BearerHttpSigner
All Known Implementing Classes:
DefaultAwsCrtV4aHttpSigner, DefaultAwsV4HttpSigner, DefaultBearerHttpSigner, DefaultS3ExpressHttpSigner, DpopSigner, NoOpHttpSigner

@SdkPublicApi public interface HttpSigner<IdentityT extends Identity>
Interface for the process of modifying a request destined for a service so that the service can authenticate the SDK customer’s identity.

You can configure the signer by first implementing a custom AuthScheme returning this signer and then configuring the AuthSchemes on the client builder via SdkClientBuilder#putAuthScheme(AuthScheme).

Example - Custom signer implementation:

S3AsyncClient s3 = S3AsyncClient.builder()
                                .region(Region.US_WEST_2)
                                .credentialsProvider(CREDENTIALS)
                                .putAuthScheme(new CustomSigV4AuthScheme())
                                .build();

public class CustomSigV4AuthScheme implements AwsV4AuthScheme {
    @Override
    public String schemeId() {
        return AwsV4AuthScheme.SCHEME_ID;
    }

    @Override
    public IdentityProvider<AwsCredentialsIdentity> identityProvider(IdentityProviders providers) {
        return providers.identityProvider(AwsCredentialsIdentity.class);
    }

    @Override
    public AwsV4HttpSigner signer() {
        return new CustomSigV4Signer();
    }

    private class CustomSigV4Signer implements AwsV4HttpSigner {
        @Override
        public SignedRequest sign(SignRequest<? extends AwsCredentialsIdentity> request) {
            // Custom implementation
        }

        @Override
        public CompletableFuture<AsyncSignedRequest> signAsync(AsyncSignRequest<? extends AwsCredentialsIdentity> request) {
            // Custom implementation
        }
    }
}

When to Use Each Approach

  • Use custom AuthSchemeProvider when you only need to override signing properties (service name, region, etc.). See AuthSchemeProvider for examples.
  • Use custom HttpSigner when you need to change the signing algorithm or logic itself.