Open abduaddis1 opened 2 weeks ago
Hello, @abduaddis1 and sorry to hear you're running into this. Can you clarify how you've configured the authorization rules on your lambda proxy and any additional configuration/setup steps you took on it?
Hello, @abduaddis1 and sorry to hear you're running into this. Can you clarify how you've configured the authorization rules on your lambda proxy and any additional configuration/setup steps you took on it?
Hello,
Authorization on my API is as follows:
{
"version": 1,
"paths": {
"/userapi": {
"name": "/userapi",
"lambdaFunction": "inclineUserFunction",
"permissions": {
"setting": "private",
"auth": [
"create",
"read",
"update",
"delete"
],
"groups": {
"admincustomers": [
"create",
"read",
"update",
"delete"
],
"employeecustomers": [
"create",
"read",
"update",
"delete"
]
}
}
}
}
}
I am unfamiliar on how to get the exact authorization rules for my lambda proxy, but the following is my lambda proxy's cloudformation template config:
I also have the following cloudformation template for my API:
If there is another way to view the authorization rules on my lambda proxy or other information you need, please let me know.
@abduaddis1, thank you for the follow up. Any chance you can share a screenshot or further details on the network logs when this happens? Trying to determine the best way to reproduce this. Thanks!
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
REST API
Amplify Version
v6
Amplify Categories
api
Backend
Amplify CLI
Environment information
Describe the bug
I set up a REST API with a Lambda proxy that is written using Python and FLASK. I was getting errors upon testing a call of the API from my front-end, and upon looking at cloudwatch logs saw that I was getting an 'InvalidSignatureException':
"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"
upon a 'get' call for this API. I have written a 'POST' method in the same API that works, which I can call from my front-end. Additionally, I have another REST API for which a nearly identical 'GET' call from the front-end will work as well. I also have tested the function using
amplify mock function
, with the following event.json:upon which the Lambda does return the expected values.
The following code is the call on the front-end that leads to the error:
And the following is the actual code for the lambda proxy attached to the API:
A call to the POST method in the above API works fine, with no InvalidSignatureException issues.
I also have another API in my application, which has a similar GET call, but this time has a user_id variable as a path parameter, and this one seems to work fine:
My values of userId for the GET call that returns an InvalidSignatureException have been both a user email and a user cognito sub that is returned from fetchUserAttributes(). The log warning is shown below
Expected behavior
The GET call should return with a status of OK and user profile information in the body of the request
Reproduction steps
Code Snippet
Log output
aws-exports.js
Manual configuration
No response
Additional configuration
No response
Mobile Device
iPhone15
Mobile Operating System
iOS17.4
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response