登录多个Google帐户时加载Google oauth2 javascript api时出错 [英] Error when loading Google oauth2 javascript api while logged into multiple Google accounts

查看:221
本文介绍了登录多个Google帐户时加载Google oauth2 javascript api时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过javascript api使用Google+登录按钮。在Windows计算机和Chromebook上一切正常,但在我能够测试它的每台Mac上都失败了。 (请参阅下面的更新2,这实际上不是Mac问题)

I am trying to use the Google+ sign in button via the javascript api. Everything works fine on Windows computers and Chromebooks, but it fails on every Mac that I have been able to test it on. (see update 2 below, this is not actually a Mac problem)

加载初始Google api文件时( https://apis.google.com/js/client:platform.js )在控制台中记录错误,说< a href =https://accounts.google.com/o/oauth2/iframerpc?scope=email+profile&response_type=token+id_token&login_hint=[HINT]&origin=[ORIGIN]&action=issueToken& ss_domain = [SS_DOMAIN]& hd = [HD]& client_id = [CLIENT_ID]& hl = en& from_login = 1& as = [AS]rel =nofollow> https://accounts.google.com ?/ O /的oauth2 / iframerpc范围=电子邮件+简档&安培; RESPONSE_TYPE =记号+ id_token&安培; login_hint = [HINT]&安培;来源= [ORIGIN]&安培;行动= issueToken&安培; ss_domain = [SS_DOMAIN]&安培; HD = [HD]&安培; client_id = [CLIENT_ID]& hl = en& from_login = 1& as = [AS] 返回服务器端错误。当我直接在浏览器中提取URL时,我得到一个带有一个属性的JSON对象:

When the initial Google api file is loaded (https://apis.google.com/js/client:platform.js) an error is logged in the console, saying that https://accounts.google.com/o/oauth2/iframerpc?scope=email+profile&response_type=token+id_token&login_hint=[HINT]&origin=[ORIGIN]&action=issueToken&ss_domain=[SS_DOMAIN]&hd=[HD]&client_id=[CLIENT_ID]&hl=en&from_login=1&as=[AS] returned a server side error. When I pull up the URL in the browser directly, I get a JSON object with one property:

{"error":"internal_server_error"}

这只发生在Mac计算机上(谷歌浏览器,没有尝试过其他浏览器),这一切都在隐身窗口中正常工作。 (请参阅下面的更新,Mac不是问题)

This only happens on Mac computers (Google Chrome, haven't tried another browser), and it all works fine in an incognito window. (see updates below, Mac is not the problem)

更新:

我已确定只有在用户登录多个Google帐户时才会出现这种情况;此外,只有当用户尝试使用其中一个未标记为默认帐户(也就是他们登录的第一个Google帐户)的帐户向我的网站进行身份验证时。

I have determined that this only happens when a user is signed in to multiple Google accounts; and moreover, only when the user is trying to authenticate to my website using one of the accounts that is not marked as the "default" account (a.k.a. the first Google account that they signed into).

这也发生在Safari上。

This also happens on Safari.

更新2:

这不是Mac问题,只是巧合的是,受影响的5个用户都使用Mac(尽管我们公司可能只有200个用户中有10个使用Mac,而且只有人报告这个错误碰巧使用的是Mac。)

This is NOT a Mac issue, it just happened to be coincidence that the 5 or so users that this affected were all using Macs (even though our company probably only has 10 out of 200 users that use Macs, and the only people reporting this error happened to be using Macs).

真正的问题发生在任何计算机上,但只有当用户登录多个Google帐户并尝试向我的身份验证时网站使用的是其中一个非默认帐户的Google帐户。

The real issue happens on any computer, but ONLY when the user is signed in to multiple Google accounts and tries to authenticate to my site using a one of their Google accounts that is not the "default" account.

PS感谢@brenjt主题更新,结果非常准确。

P.S. Thanks to @brenjt for the subject update, which turned out to be very accurate.

推荐答案

感谢报告,Blair。我们花了一段时间来深入研究这个问题的根本原因,并得到了你的评论的帮助。假设这是我们认为的错误 - 我们在上周三推出了解决问题的解决方案。如果不是这样的话,请告诉我!

Thanks for the report, Blair. It took us a while to dig into the root cause of this one, and were assisted by your comments. Assuming it's the bug we think it is - we pushed a fix to production around last Wednesday that resolves the issue. Please let me know if that's not the case!

这篇关于登录多个Google帐户时加载Google oauth2 javascript api时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆