简体   繁体   English

禁用第三方Cookie时,Google登录不执行任何操作

[英]Google Sign-in does nothing when 3rd party cookies are disabled

I am using the Google Sign-in Javascript library on my web page that runs on Python on Google App Engine. 我在我的网页上使用Google登录Javascript库,该网页在Google App Engine上的Python上运行。 Everything works fine, unless the user has 3rd party cookies disabled (in Chrome). 一切正常,除非用户禁用第三方cookie(在Chrome中)。 The signup does open the account chooser (if applicable) and asks for permissions, however after that nothing happens. 注册会打开帐户选择器(如果适用)并请求权限,但在此之后没有任何反应。

On desktop it returns to the signup page and shows following error in the console: 在桌面上,它返回到注册页面并在控制台中显示以下错误:

Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.

However I can't detect this error so I can't respond to it either. 但是我无法检测到这个错误,所以我也无法回应它。 On mobile, it just gets stuck on a white page. 在移动设备上,它只是卡在白页上。 The additional issue here is that since I am asking for offline access, the first signup returns a refresh_token. 这里的另一个问题是,由于我要求离线访问,第一次注册会返回refresh_token。 Due to this error, I never receive this refresh_token. 由于此错误,我从未收到此refresh_token。

The error mentioned above shows immediately when I load the page. 上面提到的错误会在我加载页面时立即显示。 I would like to detect this, so that I can decide not to show the button and ask the user to enable 3rd party cookies. 我想检测到这一点,以便我可以决定不显示按钮并要求用户启用第三方cookie。

您可以测试第三方Cookie是否被您自己禁用,而不是依赖于Google Signin库,例如: http//blog.jgc.org/2006/04/do-you-have-third-party-cookies.html

切换到Python后端集成以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM