AnsweredAssumed Answered

hs3 with amazon .net sdk

Question asked by Thiago Custodio on Dec 30, 2014

I'm trying to create a bucket using the sample from 'hdsit_149152.pdf' (page 34).

 

here's what I'm trying:

 

var config = new AmazonS3Config();

config.ServiceURL = "http://2015.sped-nfe.hcp-demo.hcpdomain.com/rest/";

config.UseHttp = true;

config.AuthenticationServiceName = "HCP";

           

var client = new AmazonS3Client(username.ToBase64(), password.ToMd5(), config);

var buckets = client.ListBuckets();

 

I'm getting the following error:

 

<?xml version='1.0' encoding='UTF-8'?>

<Error>

  <Code>SignatureDoesNotMatch</Code>

  <Message>The request signature we calculated does not match the signature you provided. Check your HCP Secret Access Key and signing method.</Message>

  <RequestId>1419948139971</RequestId>

  <HostId>aGNwLWRlbW8uaGNwZG9tYWluLmNvbToyMjA=</HostId>

  <StringToSignBytes>47 45 54 0A 0A 0A 0A 78 2D 61 6D 7A 2D 64 61 74 65 3A 54 75 65 2C 20 33 30 20 44 65 63 20 32 30 31 34 20 31 34 3A 30 32 3A 31 39 20 47 4D 54 0A 2F 32 30 31 35 2F 72 65 73 74 2F</StringToSignBytes>

  <AWSAccessKeyId>YWRtLXNwZWQtbmZl</AWSAccessKeyId>

  <SignatureProvided>c35E3a1n31CA0o0vxe8D6wwuhIY=</SignatureProvided>

</Error>

 

Using fiddler I've checked that the password is being encrypted inside AmazonS3Client class, that's why I'm getting this error. Is there a way to avoid this encrypt by AmazonS3Client, since I'm already passing the password encrypted?

 

Ps: I'm using .NET Framework version 4.5 and Amazon SDK Version 2.3.14.0

Outcomes