signature=3bed159966be4e0143cfc019c5f1b89b,AWS Signature Mismatched Calculation

**** PLEASE SCROLL DOWN TO UPDATE FIRST ****

**** ISSUE SOLVED, BUT LEFT MY INFO FOR OTHER NOT TO MAKE THE SAME MISTAKE ****

@SamvelRaja Thanks for your update and the new v4.8.0 Postman (and v3.1.2 Nemman) release. I tried both new versions in my specific case and the update does not seem to have fixed my issue. I first tried the new Newman release in my CI/CD solution but it did not work. Because it is more difficult to debug there I switched to Postman for debugging.

Using the new v4.8.0 Postman I still have the same issue. When trying to call my AWS API Gateway which is secured with IAM credentials (that is why I need the Sigv4 authorization) I still have errors.

Authorization config (vars are correctly loaded):

d6edb09ffa4120a20e43536f7ce3db64.png

My header after sending the POST:

27ea8bdaf9beda981a476bd0d67d33ca.png

Authorization header:

AWS4-HMAC-SHA256 Credential=ASIAIWFE3XX7CS*****/20161016/eu-central-1/execute-api/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-api-key, Signature=4b204f8408d2c6c362eefe9387b2df88bed7447e1dd39e5bea08a6*********

Error retrieving:

"message": "The security token included in the request is invalid."

Now comes the interesting part: when I use the generated cURL code from this exact call everything works fine!

generated cURL:

curl -X GET -H "x-api-key: 3UkX1NRc5t310k5rrqBna6x3c5hoAJen9B******" -H "x-amz-security-token: AgoGb3JpZ2luE****" -H "Content-Type: application/x-www-form-urlencoded" -H "X-Amz-Date: 20161016T083150Z" -H "Authorization: AWS4-HMAC-SHA256 Credential=ASIAIWFE3XX7CS******/20161016/eu-central-1/execute-api/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-api-key, Signature=4b204f8408d2c6c362eefe9387b2df88bed7447e1dd39e5bea08a6b6bd******" -H "Cache-Control: no-cache" -H "Postman-Token: 93e74922-6357-d266-4819-440b8c395cf8" "https://*****.execute-api.eu-central-1.amazonaws.com/dev/info"

Must be something different in Postman/Newman executing the request and the actual request from the generated cURL

If you need any additional info or want to do so debugging together, please contact me...

Appreciating your effort in fixing this bug!

UPDATE: did some additional debugging.

I just found out about the 'console' function in Postman and tried to do the request again:

de0fc012c5b91552b3a307c8a9c06951.png

I think the problem is that Postman never includes the 'x-amz-security-token' header in the request? It is defined (see screenshot above) but the console does not show it.

This led me to the fact that I was an idiot and that I did not notice that the new solution in v4.8.0 required an additional parameter in the Authorization especially for this:

a5ff770b389fdaf74437e8cdb60ec50b.png

If I use it the correct way it al works fine :-)

Thanks guys, will test Newman little bit later

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值