简体   繁体   中英

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. Everything works fine, unless the user has 3rd party cookies disabled (in 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. Due to this error, I never receive this 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是否被您自己禁用,而不是依赖于Google Signin库,例如: http//blog.jgc.org/2006/04/do-you-have-third-party-cookies.html

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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