In my React app all users are enabled to use a feature that makes use of an API (GraphQL) to mutate data in DB. My React app is hosted and served using AWS Amplify and my API is on AWS Appsync. Previously I used an API KEY to authenticate my app to my API, however, now I would like to change authentication method from API KEY to IAM. I have changed the Default authorization mode in the AWS Appsync Console (see attached image) and done amplify push
and amplify codegen
, however when I test my app in both development and production environment I get status code 401 (sometimes 403) from my API whenever I try to call it, what am I missing?
I haven't added any additional configuration on the app side, not sure where and how to add the appropriate credentials.
Changing directly in the console will not reflect in other environments with amplify push
also it's not recommended.
Try using amplify update api
with AWS CLI,
and do amplify push
, it will update the auth config.