本文介绍了Google登录API挂起未捕获错误无法从URL哈希获取父源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用谷歌登录JavaScript客户端数月没有问题。
但是最近当用户点击添加到主屏幕的webapp登录按钮时,登录弹出窗口只是挂起而没有显示任何内容。

I'm using Google Sign-In JavaScript client for months without problem.But recently when user tapping on sign in button from webapp that added to homescreen, the signin pop-up just hang without showing any content.

当通过调试时远程调试,控制台窗格中显示错误:

When debugged via remote debugging, an error is displayed in console pane:

Uncaught Failed to get parent origin from URL hash!

源自4188232449-v2-idpiframe.js:136(由谷歌库内部加载的javascript)。

originated from 4188232449-v2-idpiframe.js:136 (javascript loaded internally by google library).

我确定这不是编程/配置错误,因为同一个webapp以前工作了几个月没有问题,而且我没有修改任何代码。

I'm sure it's not programming/config error since the same webapp was previously working for months without problem, and I haven't modified any code.

我已尝试谷歌搜索此特定问题并浏览Google文档,了解Google登录API中的任何最新更改,但没有任何运气。

I've tried google search for this particular problem and browse Google documentation for any recent changes in Google Sign-In API without any luck.

来自Google API Javascript客户端库的错误,Android上最近的Chrome浏览器更新有什么问题,或者我还不知道API使用方面的一些变化?

Is it bug from Google API Javascript client library, glitch from recent Chrome browser update on Android, or there is some changes in API usage that I doesn't yet aware?

使用的图书馆是

这是gapi.auth2.init()的初始化参数:

This is init param for gapi.auth2.init():

{
  client_id: GAPI_CID,  // defined as constant
  cookiepolicy: 'single_host_origin',
  prompt: 'select_account',
  ux_mode: 'popup',
  fetch_basic_profile: true
}

任何见解将不胜感激。谢谢。

Any insight will be much appreciated. Thank you.

PS:这个问题与,因为在这种情况下,问题是由Google API控制台中所需凭据的配置错误引起的。
如果您从来没有成功将登录流程与您的应用程序集成,那么该帖子的答案可能对您有帮助。

P.S.: This problem is different with Uncaught Failed to get parent origin from URL hash since on that case the problem is caused by misconfiguration of required credential in Google API console.If you never had succedded in integrating sign-in flow with your app, perhaps answer from that post can help you.

否则,如果您已经成功集成登录流程已经有一段时间了,但最近出现问题突然/不正常地出现,弹出窗口出现空白屏幕症状,而不是你遇到同样的问题。

Otherwise, if you have had successfully integrated sign-in flow for some time but recently problem suddenly/erratically appears with symptom of blank screen on popped-up window, than you have same problem with me.

推荐答案

我可以确认我们最近在我公司遇到同样的问题。这似乎有点不稳定,而不是100%的时间。但是对于某些用户来说,有些时候会遇到一个空的登录弹出窗口,其中的网址指向但没有任何反应。

I can confirm we are experiencing the same problems at my company since recently. It seems a bit erratic, not 100% of the time. But for some users, some time, they are met with an empty sign-in popup with the url pointing to "https://accounts.google.com/o/oauth2/iframe" but nothing happens.

这篇关于Google登录API挂起未捕获错误无法从URL哈希获取父源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 07:34