客户端JavaScript Google登录已停止在Safari for Mac OS X v.10.15.2中工作

问题描述 投票:0回答:1

升级到Mac OS X 10.15.2版后,使用google-api-javascript-client库登录Google对某些用户在Safari中停止工作。

[Safari开发者控制台和网络选项卡并没有真正告诉我有关该特定Safari版本的问题是什么。

示例片段

<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="REPLACEME.apps.googleusercontent.com">
<div class="g-signin2" data-onsuccess="onSignIn"></div>
<script>
function onSignIn(googleUser) {
  var profile = googleUser.getBasicProfile();
  console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
  console.log('Name: ' + profile.getName());
  console.log('Image URL: ' + profile.getImageUrl());
  console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
}
</script>

文档:https://developers.google.com/identity/sign-in/web

safari google-authentication google-api-js-client
1个回答
0
投票

似乎是使用Safari首选项隐私]的Mac OS X v10.15.2的新更新,> 跟踪:防止跨站点跟踪 未选中并已通过Google客户端登录JavaScript库损坏。

尽管在Safari隐私首选项中具有已跟踪:防止跨站点跟踪

选项已选中,但在Safari专用Windows中无法使用Google登录。

请参见github问题:https://github.com/google/google-api-javascript-client/issues/589

此问题似乎不仅限于google-api-js-client库:https://www.reddit.com/r/Safari/comments/eaaanh/safari_1304_on_macos_changes_to_prevent_crosssite/

© www.soinside.com 2019 - 2024. All rights reserved.