Skip to content

Need provision to pass Body as parameter while presigning requests using sign_v4_query_params #14

Closed
@aravindanck

Description

Team,

Java SDK has two classes for signing requests with AWS4 signing protocol
AWS4UnsignedPayloadSigner.java - https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/java/com/amazonaws/auth/AWS4UnsignedPayloadSigner.java
AWS4Signer.java - https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/java/com/amazonaws/auth/AWS4Signer.java

AWS4UnsignedPayloadSigner adds "UNSIGNED-PAYLOAD" as body if the request is sent over HTTPS whereas AWS4Signer doesn't add "UNSIGNED-PAYLOAD" as request body for pre-signing

Background:
I'm trying to authenticate with AWS MSK via AWS_MSK_IAM SASL mechanism in Elixir and it needs me to presign the request without adding "UNSIGNED-PAYLOAD" as part of its canonical request. I see that aws_signature adds "UNSIGNED-PAYLOAD" as part of pre-signing here

Body = <<"UNSIGNED-PAYLOAD">>,
.

This causes issues when I try to pre-sign requests to authenticate with services like Amazon MSK via IAM. Rather than always sending "UNSIGNED-PAYLOAD" as body, is it possible to have a provision to send "UNSIGNED-PAYLOAD" only when Body parameter is nil, otherwise use what is sent as Body? This needs modifying the api's definition to add Body as an additional parameter. Let me know if there are better alternatives to tackle this.
https://hexdocs.pm/aws_signature/aws_signature.html#sign_v4_query_params/8

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions