profile
viewpoint

Ask questionsThe request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method

i'm getting AWS signature mismatch when i send request to API Gateway using axios

let data = JSON.stringify({
    "action": "message",
    "data": 'testing'
  })


let request = {
  host: '<API GATEWAY ID>.execute-api.<AWS REGION>.amazonaws.com',
  url: 'https://<API GATEWAY ID>.execute-api.<AWS REGION>.amazonaws.com/dev/@connections/<CONNECTION ID>',
  path: 'dev/@connections/<CONNECTION ID>',
  service: 'execute-api',
  region: '<AWS REGION>',
  data: data,
  body: data,
  headers: {
    'Content-Type': 'application/json'
  }
}

let signedRequest = aws4.sign(request,
                {
                  secretAccessKey: '<AWS SECRET KEY>',
                  accessKeyId: '<AWS ACCESS KEY>'
                })

let response = axios(signedRequest)
mhart/aws4

Answer questions mhart

Closing as an issue with axios, not this library

useful!

Related questions

Credential must have exactly 5 slash-delimited elements hot 2
Github User Rank List