📜  cloudfront-key-pair-id cookie (1)

📅  最后修改于: 2023-12-03 15:30:01.436000             🧑  作者: Mango

CloudFront Key Pair ID 和 Cookie

简介

CloudFront Key Pair ID 和 Cookie 是 Amazon CloudFront 的身份验证机制,用于授权用户对受保护的内容资源的访问。

Key Pair ID

每个 CloudFront Key Pair ID 都与一个公钥和私钥对关联。这对密钥由用户自己生成并保存,用于验证从特定的 Amazon S3 存储桶或自定义来源请求的内容。对于每个资源分配一个 Key Pair ID 可以在保护策略上实现更精细的控制。

Cookie

CloudFront Cookie 是 CloudFront Key Pair ID 的一种形式,它包含了签名并与指定资源相关联的一组有关于请求的信息。通过在请求头中传递此 Cookie,CloudFront 可以验证请求是否得到了授权。

在需要授权访问的打包资源(static)的 CloudFront 分发 (distribution) 中,用户首次访问资源时,CloudFront 会为用户签署一个 Cookie,保存到客户端浏览器中,用户再次访问资源时,此 Cookie 会自动传递,并被用于验证用户是否具有访问权限。

总结

CloudFront Key Pair ID 和 Cookie 结合使用为云端存储、分发提供了更细致的安全措施,帮助用户保护自己的内容资源,防止被非法访问。

使用方法具体可参考AWS官方文档