Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'https://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource

I am working on AWS Cognito to authenticate APIs and using Amazon Cognito Identity JS with amplify. I added authorizer in API Gateway and it gives me error of cors when i login with cognito users but without authorizer it workes fine.

here is the error.

enter image description here

like image 270
Tayyab Avatar asked Oct 12 '25 08:10

Tayyab


2 Answers

You should set CORS details on your API services with "Enable CORS" and add your authorization header name here.

like image 120
senaykt Avatar answered Oct 16 '25 07:10

senaykt


Added a chrome extension named Moesif CORS to temporarily solve this problem. Didn't find a proper solution yet.

like image 24
Tayyab Avatar answered Oct 16 '25 07:10

Tayyab



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!