Google Sign-In API Hang with uncaught error Failed to get parent origin from URL hash [英] Google Sign-In API Hang with uncaught error Failed to get parent origin from URL hash

查看:37
本文介绍了Google Sign-In API Hang with uncaught error Failed to get parent origin from URL hash的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Google Sign-In JavaScript 客户端几个月没有问题.但是最近当用户从添加到主屏幕的 web 应用程序中点击登录按钮时,登录弹出窗口只是挂起而不显示任何内容.

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).

我确定这不是编程/配置错误,因为同一个 web 应用程序以前可以正常工作数月,而且我没有修改任何代码.

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.

我已经尝试在谷歌搜索这个特定问题并浏览谷歌文档以了解谷歌登录 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?

使用的库是 https://apis.google.com/js/platform.js

这是 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:这个问题与 Uncaught Failed get 不同来自 URL 哈希的父源,因为在这种情况下,问题是由 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% 的时间.但是对于某些用户,有时会遇到一个空的登录弹出窗口,其中 url 指向https://accounts.google.com/o/oauth2/iframe",但没有任何反应.

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 Sign-In API Hang with uncaught error Failed to get parent origin from URL hash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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