Git Product home page Git Product logo

ecs-object-client-dotnet's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

markhe1222

ecs-object-client-dotnet's Issues

ECS .NET SDK request signature does not match bug

There are 22 ASCII characters that will work with the JAVA SDK but not with the .NET SDK when being set as as part of the metadata keys.
ECS returns Http code 403 with message:

β€œThe request signature we calculated does not match the signature you provided. Check your Secret Access Key and signing method. For more information, see REST Authentication and SOAP Authentication for details.”

Analysis

When the SDK signs the request that will be verified on the server, it orders the keys (headers) using "StringComparer.OrdinalIgnoreCase". But, on the server, the JAVA version generates a different signature, thus, it does not match and throws a 403 Signature Does not match

Method: static string BuildCanonicalizedHeaders(IDictionary<string, string> headers)

Class:
S3SignerECS

Version: v1.0.1

Repro steps

You can find attached two unit test projects showcasing the bug, one for NET and one for JAVA.

If you run the same example, you will notice with the JAVA SDK, you won't get the Signature match error. Most likely because the JAVA SDK uses the TreeMap class that performs a natural ordering.

dotnetUnderscoreECSTest.zip

JavaUnderscoreECSTest2.zip

Solution

We'd need a fix on the .NET SDK that signs the request same way the JAVA one does.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.