简体   繁体   English

在哪里放置 Cloudfront 密钥对以进行 Wordpress 身份验证

[英]Where to place Cloudfront Key Pairs for Wordpress Authentication

Been following this guide on AWS: AWS Serving Private Content一直在 AWS 上关注本指南: AWS 服务私有内容

I have setup a web cloudfront distribution and what I am doing is serving private content from my s3 bucket using an Origin Access Identity to access the resources within.我已经设置了一个 Web 云端分发,我正在做的是使用 Origin Access Identity 来访问我的 s3 存储桶中的私有内容以访问其中的资源。

I am running into a roadblock when it gets to the cookie and signed url authentication--I am using wordpress.当它到达 cookie 和签名 url 身份验证时,我遇到了障碍——我正在使用 wordpress。 I have my cloudfront key pairs, but I am not quite sure where to go from here.我有我的云端密钥对,但我不太确定从这里去哪里。

I have successfully served content via cdn when not using OAI and utilizing WP TotalCache plugins and such, but too many things are needed to be made public and the bucket policys for url and ip address restrictions are not quite working for me.在不使用 OAI 和使用 WP TotalCache 插件等的情况下,我已经通过 cdn 成功地提供了内容,但是需要公开的东西太多了,而且 url 和 ip 地址限制的存储桶策略对我来说不太适用。

This step in process pretty much sums up where I am stuck:这个过程中的步骤几乎总结了我被困的地方:

Write your application to respond to requests from authorized users either with signed URLs or with Set-Cookie headers that set signed cookies.编写您的应用程序以使用签名 URL 或设置签名 cookie 的 Set-Cookie 标头响应授权用户的请求。 For more information, see Choosing Between Signed URLs and Signed Cookies.有关详细信息,请参阅在签名 URL 和签名 Cookie 之间进行选择。

Any next steps or suggestions would be very much appreciate.任何后续步骤或建议将不胜感激。

Thanks a lot!非常感谢!

Sean肖恩

Step 1 - Choose between signed URLs and Cookies. 第1步 -在签名的URL和Cookies之间进行选择 Use Signed Cookies if your users need access to multiple files (restricted area in Wordpress). 如果您的用户需要访问多个文件(Wordpress中的限制区域),请使用“签名Cookie”。

Step 2 - Specify the AWS accounts for the creation of signed URLs/Cookies. 步骤2- 指定用于创建签名URL / Cookie的AWS账户。

Step 3 - Develop your app to set the three required cookies (CloudFront-Key-Pair-Id, CloudFront-Signature and CloudFront-Policy/CloudFront-Expires). 步骤3- 开发您的应用程序以设置三个必需的cookie(CloudFront-Key-Pair-Id,CloudFront-Signature和CloudFront-Policy / CloudFront-Expires)。

Alternatively use the AWS SDK to generate signed URLs/Cookies. 或者,使用AWS开发工具包生成签名的URL / Cookie。 ie: PHP's getSignedUrl() or getSignedCookie() methods. 即:PHP的getSignedUrl()getSignedCookie()方法。

Did you end up implementing the code in the functions.php?你最终实现了 functions.php 中的代码了吗? I'm looking to do the same, but the link provided by gboda is expired.我也想这样做,但 gboda 提供的链接已过期。 I would really appreciate it if you could post the final code snippet here.如果您能在这里发布最终代码片段,我将不胜感激。

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

相关问题 wordpress 网站上的 Firebase 身份验证 - Firebase Authentication on wordpress website 在 NodeJS 中使用 Lambda@Edge 对 CloudFront 进行基本 HTTP 身份验证 - Basic HTTP Authentication for CloudFront with Lambda@Edge in NodeJS 使用相同的值更新 aws_cloudfront_public_key encoded_key 强制替换 - Updating aws_cloudfront_public_key encoded_key with the same value forces replacement 是否可以根据键的一部分过滤键值对? - Is it possible to filter key value pairs based on a section of the key? 在 React 中放置 firebase.auth().onAuthStateChanged 的位置 - where to place firebase.auth().onAuthStateChanged in React 使用 Cloudfront 和 AWS Lambda 对 S3 托管网站进行身份验证时出现 503 错误 - 503 error in authentication using Cloudfront and AWS Lambda for S3 hosted website Amazon Textract - 如何定义我的键值对 - Amazon Textract - How to define my key-value pairs CloudFront + S3 网站:应显示隐式索引文档时“指定的键不存在” - CloudFront + S3 Website: "The specified key does not exist" when an implicit index document should be displayed Firebase 身份验证:web 中的令牌存储在哪里? - Firebase Authentication: Where is the token stored in web? GCP - 在 VM 重启时更改 wordpress 中的新 IP 的位置 - GCP - Place to change new IP in wordpress on VM restart
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM