Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 719
Athelstone Avatar asked Oct 09 '18 05:10

Athelstone


1 Answers

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.

like image 143
sniii Avatar answered Oct 08 '22 20:10

sniii