tsibelman / aws-signer-v4-dot-net

Sign HttpRequestMessage using AWS Signature v4 using request information and credentials.
Apache License 2.0
72 stars 27 forks source link

Update AWS4RequestSigner.cs Sort Comparer #31

Closed branch-slalom closed 3 years ago

branch-slalom commented 3 years ago

I recently made a change to the sort comparer for the query params to use the StringComparer.OrdinalIgnoreCase (see PR https://github.com/tsibelman/aws-signer-v4-dot-net/pull/29) instead of the default

Ordinal is required to satisfy AWS's requirements but OrdinalIgnoreCase was used instead to follow AWS's internal signer.

We recently encountered a similar issue as before and discovered that the using "Ignore Case" was not producing the expected signature so we switched to Ordinal and that resolved the issue. The docs also mention briefly that casing is NOT ignore so I suspect that the AWS internal signer is incorrect.

Sort the parameter names by character code point in ascending order. Parameters with duplicate names should be sorted by value. For example, a parameter name that begins with the uppercase letter F precedes a parameter name that begins with a lowercase letter b.

branch-slalom commented 3 years ago

@tsibelman Can you have a look at this?

tsibelman commented 3 years ago

Thanks I published a new version