AWS Amplify Gateway REST - React & React Native (403) #2794
Labels
API
Related to REST API issues
investigating
This issue is being investigated
React Native
React Native related issue
I am looking to create one API via AWS Amplify that I can query/post to from React and React Native. I set up the API and Lambdas via serverless, and a user pool manually via the Cognito console, with separate app clients for each platform.
I manually configured Amplify in the RN repo with the same values as in the React project, except for APP_CLIENT_ID, to match the app client in the user pool in Cognito.
The Amplify Auth calls (SignIn, SignUp) all work fine, so the config is at least semi-ok. It's just the REST API calls that do not. 403s, Missing Authentication Token. (Same user). I poked around the documentation and saw that I may need to use a custom_header in my Native config:
Setting this custom_header clears the Missing Authentication Token error, but now I get: Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header.
I compared the full requests via the Chrome console, and it looks like the Authorization header in React is correctly generated via Amplify, with Credential, Signature, SignedHeader, etc. It looks vastly different in Native, as the custom_header change above just sets the Authorization header to a jwtToken.
Thoughts here? Is something like this even supported?
Thanks.
The text was updated successfully, but these errors were encountered: