- 新しい順
- 投票が多い順
- コメントが多い順
It seems like there might be an issue with how CloudFront is handling the Authorization header for GET requests. By default, CloudFront does not forward certain headers, including the Authorization header, to the origin server for GET requests when caching is enabled.
Here are a few steps you can try to resolve the issue:
Use a CloudFront Lambda@Edge Function: You can also use a Lambda@Edge function to modify the request before it reaches the origin server. This function can add or modify headers, including the Authorization header, for specific request paths or methods. Here's a guide on how to use Lambda@Edge with CloudFront: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-at-the-edge.html
Check CORS Configuration: If you're using CORS (Cross-Origin Resource Sharing) on your API, ensure that the CORS configuration allows the Authorization header for GET requests. Misconfigured CORS settings can sometimes cause issues with headers not being forwarded correctly.
Try one or more of these solutions and see if it resolves the issue with the Authorization header not being forwarded for GET requests in CloudFront.
関連するコンテンツ
- AWS公式更新しました 2年前
- AWS公式更新しました 2年前
- AWS公式更新しました 2年前
I confirmed that with the same settings as you have depicted in your picture, I am able to use both POST and GET methods and the Authorization header is making it to the origin. I'm not setup to do anything with the header, but I can confirm it reaches the backend target. Can you provide more details of your setup, such as what kind of origin?