我有一个依赖于SharedArrayBuffer的web应用。我在我的网站上打开了跨域隔离,因为google chrome将在月底需要它。
然而,这样做会破坏谷歌的oAuth2登录。
我试图在打开跨源标志的情况下导入auth脚本,但没有成功,因为它会依次尝试导入其他被阻止的脚本。
login.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最好的方法是什么?
谢谢,
发布于 2021-06-14 10:40:23
打破跨域隔离破坏OAuth集成是一个已知问题(请参阅the box in this page,以“更新,2021年4月”开始)。请使用apply to the origin trial继续使用无跨域隔离的SharedArrayBuffer。
该团队正在努力放宽限制。
https://stackoverflow.com/questions/67017005
复制相似问题