简体   繁体   English

为多个路径设置 Cloudfront 签名的 cookies

[英]Setting up Cloudfront signed cookies for multiple paths

How do you setup signed cookies for multiple separate paths within a Cloudfront distribution?您如何为 Cloudfront 分发中的多个单独路径设置签名 cookies

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.我已成功设置签名 cookies 以验证对分布下模式“path1/”的访问,但现在我想在同一分布下设置对模式“path2/”的单独互斥身份验证访问,以便我可以授予不同的访问权限用户。

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.但是,据我所知,Cloudfront 的签名 cookies 仅使用一组三个 cookies,分别命名为 CloudFront-Policy、CloudFront-Signature 和 CloudFront-Key-Pair-Id,因此推测它一次只能授予对一个位置的访问权限。

Is there any way to support access to multiple locations?有什么方法可以支持访问多个位置?

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 (/*).改用 CF 签名的 url,如果你有充分的理由使用签名的 cookie,我能想到的唯一可能的解决方案是验证parentOf('/path1/', '/path2/')这是根 (/*) .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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