0

I am trying to call aws api gateway with a post request with signed headers. In iOS it works perfectly fine, while I get 403 with exactly the same request running the App in Android(of course with different credentials).

What I already found is this similar issue, but appending the charset "charset=utf-8", did not solve the issue for me unfortunately. Switching to the amplify package is currently not an option. Can anybody give me a hint?

I am using react-native: 0.67.2, agnostic-aws-signature: 1.0.6 and axios: 0.24.0

Fapi
  • 323
  • 2
  • 15

1 Answers1

0

I got this solved now by doing the following:

  1. Setup cloudwatch to log the access events like this: Setting up CloudWatch logging for a REST API in API Gateway
  2. Adding $context.error.message to be logged.
  3. Trying to make the post request and checking the answer with the following result:

"error": "Signature not yet current: 20220206T163415Z is still later than 20220206T153916Z (20220206T153416Z + 5 min.)",

Looks like the Simulator used a different time zone, so I could resolve it with setting the clock and time zone manually.

Fapi
  • 323
  • 2
  • 15