Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
154 views
in Technique[技术] by (71.8m points)

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

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!

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

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.

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.

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?

Library used is https://apis.google.com/js/platform.js

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.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...