具有跨源隔离的 Google oAuth2 登录

问题描述

我有一个依赖 SharedArrayBuffer 的网络应用程序。我在我的网站上开启了跨域隔离,因为谷歌浏览器将在月底前要求它。

但是,这样做会中断 Google oAuth2 登录

我尝试导入带有跨域标志的 auth 脚本,但没有成功,因为它依次尝试导入其他被阻止的脚本。

登录.html

...

var script = document.createElement('script');
script.src = "https://apis.google.com/js/platform.js?onload=init";
script.setAttribute('async','true');
script.setAttribute('defer','true');
script.setAttribute('crossorigin','');
document.getElementsByTagName('head')[0].appendChild(script);
...

仍然可以使用谷歌的 oAuth2 的最佳方法是什么?

谢谢,

解决方法

跨域隔离破坏 OAuth 集成是一个已知问题(请参阅以“2021 年 4 月更新”开头的 the box in this page)。请apply to the origin trial在没有跨域隔离的情况下继续使用 SharedArrayBuffer。

团队正在努力放宽限制。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...