Safari浏览器中iframe的cookie

6

最新的Safari浏览器更新在iframe中阻止第三方cookie。(https://webkit.org/blog/10218/full-third-party-cookie-blocking-and-more/

他们提供了几个解决方案来解决此问题。我尝试实现了Storage Access 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。根据 选项1,3rdparty.com 通过 OAuth 授权,并接收令牌。但是,“将令牌转发到您的网站以建立登录会话”是什么意思?是否应该让第三方在单独的窗口中作为第一方运行登录例程?


你有没有找到解决方案? - Tafel
1个回答

1
他们所指的是仍然将cookie作为第一方(在您的网站上)。例如:
用户遵循以下流程:
1. 转到website.com 2. 重定向到oauthSite.com进行身份验证 3. ouathSite.com使用令牌(或代码)重定向回website.com 4. website.com在服务器端代码上本地设置令牌 5. 用户现在拥有安全的(仅限https)和HttpOnly(无法访问JavaScript)cookie令牌,可用于与website.com进行无状态交互
该网站似乎非常好地完成了这些流程: https://medium.com/@darutk/diagrams-and-movies-of-all-the-oauth-2-0-flows-194f3c3ade85

1
但是在iframe中放置cookie有帮助吗?我仍然需要在iframe中放置网站。 - Sergey Korzhov

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接