cookies - iframe 中的 Safari cookie
问题描述
最新的 Safari 更新阻止 iframe 中的第 3 方 cookie。(https://webkit.org/blog/10218/full-third-party-cookie-blocking-and-more/)
他们提供了几种解决方案来解决它。我试图实现存储访问 API 解决方案,但确实喜欢结果。
任何人都可以在没有有关如何实现此功能的技术细节的情况下给出提示或示例流程:
Option 1: OAuth 2.0 Authorization with which the authenticating domain (in your case, the third-party
that expects cookies) forwards an authorization token to your website which you consume and use to
establish a first-party login session with a server-set Secure and HttpOnly cookie.
firstparty.com 在 iframe 中有 3rdparty.com。根据option 1
3rdparty.com 通过 OAuth 授权,接收令牌。但是“将令牌转发到您的网站以建立登录会话”是什么意思?3rdparty.com 是否应该在单独的窗口中以第一方身份运行登录例程?
解决方案
他们指的是仍然让 cookie 成为第一方(在您的网站上)。例如:
用户遵循以下流程:
- 访问 website.com
- 重定向到 oauthSite.com 进行身份验证
- ouathSite.com 使用令牌(或代码)重定向回 website.com
- website.com 在服务器端代码上本地设置令牌
- 用户现在拥有可用于与 website.com 进行无状态交互的安全(仅限 https)和 HttpOnly(JavaScript 无法访问)cookie 令牌
这个网站似乎认为流程很好: https ://medium.com/@darutk/diagrams-and-movies-of-all-the-oauth-2-0-flows-194f3c3ade85
推荐阅读
- node.js - 使用带有节点/快递的书架返回搜索时更改列的名称?
- python - Python 键盘库仅在打包时出现溢出错误
- r - 选定的本地文件不显示具有不同标准的闪亮应用程序
- jsp - 我的主机将 java web 文件显示为原始文件
- html - SVG 在 Firefox 中使用标签非均匀缩放
- javascript - 将数组中的每一项转换为对象
- tidycensus - get_acs() 是否支持“县细分”地理
- php - 如何将 2 张图片上传到两个不同的文件夹(codeginiter)
- angular - 带有应用程序负载均衡器的 Angular 6 应用程序
- highcharts - Highcharts 显示两个具有相同值的线系列