aws-api-gateway

Fix CORS “Response to preflight…” header not present with AWS API gateway and amplify

∥☆過路亽.° 提交于 2020-08-27 08:24:29
问题 I've been struggling so long with the error below. I've tried so many tutorials and stackoverflow answers and none of the solutions fixes my problem. Access to XMLHttpRequest at 'https://xxx' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. I'm using SAM serverless to create my api. template.yaml: Globals: Function: Timeout: 10 Api:

Missing Authentication Token Error with CloudFront & API Gateway

依然范特西╮ 提交于 2020-08-24 08:21:07
问题 I have setup a CloudFront Distribution with an API Gateway as one of the origins and this API Gateway is configured with an AWS IAM authorizer. When CloudFront url is invoked with Authorization headers, it returns a 403 error. { "message": "Missing Authentication Token" } However, when the API Gateway url is invoked instead of CloudFront url with the same Authorization headers, it worked. I've also tried invoking the endpoint without any authorizer via CloudFront url and it worked. Any idea