简体   繁体   中英

403 Forbidden error using Cloudfront signed cookies?

Very weird behaviour I am seeing.

I am using cloudfront signed cookies to give restricted access to a group of files in cloudfront. On most internet connections this works fine. But on some others, I get a 403 Forbidden error.

Is there anything specifically I can be looking at here? ie some behaviour by some internet connections that prevents cloudfront cookies from working. Nothing to do with the machine itself as my laptop will work fine on some wifi connections but not on others.

Any help would be great, as I am really at a loss with this one.

Update - It seems that it does not work when trying to access the files from IpV6 ip address. Any ideas?

Thanks!

This has been fixed now!

I had to set the ip address to null in the code that defines custom policy and now it works fine for both IPv4 and IPv6 ip addresses. 0.0.0.0/0 only allows all IPv4 ip addresses access, since this feature doesn't support IPv6.

IP addresses in IPv6 format, such as 2001:0db8:85a3:0000:0000:8a2e:0370:7334, are not supported.

If you're using a custom policy that includes IpAddress , do not enable IPv6 for the distribution.

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-setting-signed-cookie-custom-policy.html#private-content-custom-policy-signature-cookies

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM