You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. The Canonical String for this request should have been
#1
Hi, I'm trying to implement API Gateway IAM Authorisation. Everytime I do request I'm getting this error message. The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. The Canonical String for this request should have been
Here's my code:
const axios = require ( 'axios')
const aws4 = require ( 'aws4-react-native');
var data = JSON.stringify({"email":"****.com","password":"******"});
const opts = {
host: '****.execute-api.eu-west-1.amazonaws.com',
method: 'post',
url: 'https://****.execute-api.eu-west-1.vpce.amazonaws.com/DCCuro/signin',
data,
'Content-Type': 'application/json',
x
}
const headers = aws4.sign(opts,
{
accessKeyId: '******',
secretAccessKey: '******'
}
)
axios(headers).then(body => {
console.log(body)
}).catch(err => {
console.log(err.response)
})
Here's how signed object by `aws4.sign` looks like
{
method: 'post',
url: 'https://****.execute-api.eu-west-1.amazonaws.com/****/****',
data: '{"email":"*****","password":"******"}',
'Content-Type': 'application/json',
headers: {
Host: '*****.execute-api.eu-west-1.amazonaws.com',
'X-Amz-Date': '20200624T104207Z',
Authorization: 'AWS4-HMAC-SHA256 Credential=***Creds**/20200624/eu-west-1/execute-api/aws4_request, SignedHeaders=host;x-amz-date, Signature=****Sig****'
},
path: '/'
}
Here's the message from error
```message: 'The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for detail'
'The Canonical String for this request should have be'
"'PO"
'/****/**'
'host:*****.execute-api.eu-west-1.amazonaws.c'
'x-amz-date:20200624T10420'
'host;x-amz-da'
"****HASH1***"
'The String-to-Sign should have be'
"'AWS4-HMAC-SHA2"
'20200624T10420'
'20200624/eu-west-1/execute-api/aws4_reque'
"***Different hash***"```
Can you advice what's wrong ?
The text was updated successfully, but these errors were encountered:
Hi, I'm trying to implement API Gateway IAM Authorisation. Everytime I do request I'm getting this error message.
The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. The Canonical String for this request should have been
Here's my code:
The text was updated successfully, but these errors were encountered: