-
-
Save darbelaez/d5b802a8f0600076a3f19fc0161a367e to your computer and use it in GitHub Desktop.
@Ivthillo this file would be placed in the CloudFront site it self (the starting page) where your Signed URL is redirecting the user to. The flow would look something like this...
-
website 1 would generate a Signed URL to website 2 (CloudFront) the user can click on or redirected to automatically (i.e. http://mysite.com/landing.html)
-
website 2's "landing.html" file should contain the javascript noted above. This will allow website 2 to switch from using the signed url to now use Signed Cookies based on the information from the Signed URL.
Home this helps
@darbelaez Thank you for the info. Did the setup but it seems the script expects a signed URL with a custom policy. Is this a requirement or can this work with a canned policy too?
Thanks, got it working with the signed URL with custom policy. After doing it, it became clear how the custom policy is used by the signed cookies.
Thanks, got it working with the signed URL with custom policy. After doing it, it became clear how the custom policy is used by the signed cookies.
Yes! forgot to mention that - i was using a Custom policy - did not try it with a Canned policy but i'm it can be made to work with one with some minor modification. Glad to hear it's working for you.
How does this work for SPA applications?
Can I just put this script in S3? I've currently setup a CloudFront distribution with S3 as origin. I've uploaded this script in the bucket. When I create a signed URL to this script I'm able to visit the script in my browser but I'm missing some additional context here probably (I'm not a js developer).