0

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

但是,这样做会破坏 Google oAuth2 登录。

我尝试使用跨域标志导入身份验证脚本,但没有成功,因为它依次尝试导入其他被阻止的脚本。

登录.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);
...

哪个是仍然能够使用 google 的 oAuth2 的最佳方法?

谢谢,

4

1 回答 1

1

破坏 OAuth 集成的跨域隔离是一个已知问题(请参阅本页中以“2021 年 4 月更新”开头的方框)。请申请源试用继续使用 SharedArrayBuffer 而不进行跨源隔离。

该团队正在努力放宽限制。

于 2021-06-14T02:40:22.647 回答