0
votes

How do you setup signed cookies for multiple separate paths within a Cloudfront distribution?

I've successfully setup signed cookies to authenticate access to the pattern "path1/" under a distribution, but now I want to setup separate mutually exclusive authenticated access to the pattern "path2/" under the same distribution so I can grant access to different users.

However, as far as I know, Cloudfront's signed cookies only use one set of three cookies named CloudFront-Policy, CloudFront-Signature, and CloudFront-Key-Pair-Id, so presumably it can only grant access to one location at a time.

Is there any way to support access to multiple locations?

1
Have you tried including multiple statements in your policy? - kichik

1 Answers

0
votes

Use CF signed urls instead! If you have really good reason to use signed cookies, the only possible solution I can think of is to authenticate parentOf('/path1/', '/path2/') which is the root (/*).