You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
Google Sign-In JavaScript client not working on PWA App #473
Since yesterday when I use the gapi.auth2 to do a Google Sign-in on an installed PWA app on Android, the App opens the browser window to select the user, but it remains blank.
The same page on the Chrome browser on Android open the user selection as usual. The code is the same, from the same server. The code was not modified in more than 15 days. I presume the problem is some change in the gapi JS client code from Google servers.
Inspecting the PWA Google Sign-in tab on chrome show the following error:
Uncaught Failed to get parent origin from URL hash!
Anyone has any clue how to solve this?
Reacted by Josselin Philippe, Sachin Rekhi, Stephen Eisenhauer, Beau Kinstler, Belarbi Yacine, Marco Wittwer, mike-seekwell, Boris Hocdé, Jon, adam and 12 more
I also just started experiencing this issue about a day ago in my Electron app. User clicks the Sign-In with Google button within my Electron app (which is just a light-weight wrapper around a website), a pop-up window appears, but the window is blank instead of showing the typical Google login options.
The following error is shown in the console in the pop-up window:
Uncaught Failed to get parent origin from URL hash!
4188232449-v2-idpiframe.js:136
When I Sign-In with Google directly from our website in Chrome, it works fine. So seems like an issue potentially with an interaction with Electron.
Everything was working fine for months and this issue just started occurring about a day or so ago. So seems like a change might have been made on the Google side.
We're seeing a similar issue in our iOS and Android application which are web view wrappers around a website. When the user clicks the button we trigger native auth. Until Monday at about 11:30 am PST. Now when the user attempts to login they are redirected to a blank screen. We didn't make any code or configuration changes the correspond with the failures.
Affecting us too, for the last day or so. It seems like if you click the sign in button again, while the blank popup is still open from your last attempt, then it goes through (the popup navigates to the correct URL). But every time I click the sign in button without the popup already open, it just opens the blank popup containing the console error.
also noticed it started happening on plain old flask web app I had built a few months ago. It was working yesterday one moment, then the next, it just stopped. I had been about to test moving it to a new server, so I had been actively testing on the original. I haven't seen the workaround @BHSPitMonkey just mentioned work on any linux desktop browsers, with my primary user. I tried it on iOS chrome, and it worked first with my primary gmail.com email address user, then I tried my Google Apps user, and it hung at "Sending login request to Google...". , (but that could be more a coding error on my part, having to do with setting up new users if they don't exist. It's been a while since I made this app, and I thought that had been working, by maybe not)
If I retry with my primary gmail user, it still works after that on both iOS browswers. Still not able to get it to work on Linux Ubuntu 16.04 Google Chrome, however.
I also get the "Uncaught Failed to get parent origin from URL hash!"
EDIT: After clearing cookies, i was able to get my primary Gmail user working. Still no luck on new users, but I'm guessing there's a problem on my end.
As it might be easier for me, since I'm not dealing with anything in real production, I tried changing the client secrets, resetting the secret. That didn't change anything for me. I've also updated my domain ownership, as that wasn't done yet. Still the same problems. My app is now letting me log in, but it's supposed to also register new accounts in the DB when they don't exist, which isn't happening. Again, I suspect that's my fault, but I'll report back if I find otherwise.
my issue was related to some users not having a 'name' key come back from google. I'm not sure it has to do with scopes, or if it's even a new thing. I wonder if the recent Google+ problems sparked something about authorizations to access that key. I changed my logic to derive a name from the email address instead, and all is well for me.
@grant any chance you could help bring this to the attention of the right folks at Google? This appears to be a regression introduced a few days ago causing Google sign-in to now fail in a variety of settings.
Reacted by Jon, mike-seekwell, adam and Noah Horwitz
It's hard to tell if the offending change is in the gapi client or on the server, but there was definitely a regression this week. It's still happening to me, but it's sporadic.
Clicking on the "Sign in" button on the sign-in developer page works in Chromium, but not Firefox. Firefox returns the "uncaught exception: Failed to get parent origin from URL hash!" error.
I have started facing the same issue where pop goes blank and url is accounts.google.com/o/oauth2/iframe. In browser, this works just fine. I noticed that in browser when the google pop up appears, client id is being passed in it and when opened as a PWA, client id is not being passed and hence url for pop is not constructed. That might be one of the reason.
I don't see this as a node package issue. I request Google to resolve this issue at the earliest.
Also since i am using this package for google login, i cannot change popup to redirecturi. Hence i need a workaround in angular 6. Please suggest if any. @adamazad can you suggest a workaround in angular 6 using the package i have used?
Thank You!
Activity
sachinrekhi commentedon Oct 9, 2018
I also just started experiencing this issue about a day ago in my Electron app. User clicks the Sign-In with Google button within my Electron app (which is just a light-weight wrapper around a website), a pop-up window appears, but the window is blank instead of showing the typical Google login options.
The following error is shown in the console in the pop-up window:
When I Sign-In with Google directly from our website in Chrome, it works fine. So seems like an issue potentially with an interaction with Electron.
Everything was working fine for months and this issue just started occurring about a day or so ago. So seems like a change might have been made on the Google side.
A few other people have also run into this issue on Stack Overflow in the last day: https://stackoverflow.com/questions/52713993/google-sign-in-api-hang-with-uncaught-error-failed-to-get-parent-origin-from-url?noredirect=1&lq=1
frankljbe commentedon Oct 10, 2018
We're seeing a similar issue in our iOS and Android application which are web view wrappers around a website. When the user clicks the button we trigger native auth. Until Monday at about 11:30 am PST. Now when the user attempts to login they are redirected to a blank screen. We didn't make any code or configuration changes the correspond with the failures.
BHSPitMonkey commentedon Oct 11, 2018
Affecting us too, for the last day or so. It seems like if you click the sign in button again, while the blank popup is still open from your last attempt, then it goes through (the popup navigates to the correct URL). But every time I click the sign in button without the popup already open, it just opens the blank popup containing the console error.
sachinrekhi commentedon Oct 11, 2018
@BHSPitMonkey are you experiencing the issue in an Electron app, mobile web view, or something else?
beaukinstler commentedon Oct 11, 2018
also noticed it started happening on plain old flask web app I had built a few months ago. It was working yesterday one moment, then the next, it just stopped. I had been about to test moving it to a new server, so I had been actively testing on the original. I haven't seen the workaround @BHSPitMonkey just mentioned work on any linux desktop browsers, with my primary user. I tried it on iOS chrome, and it worked first with my primary gmail.com email address user, then I tried my Google Apps user, and it hung at "Sending login request to Google...". , (but that could be more a coding error on my part, having to do with setting up new users if they don't exist. It's been a while since I made this app, and I thought that had been working, by maybe not)
If I retry with my primary gmail user, it still works after that on both iOS browswers. Still not able to get it to work on Linux Ubuntu 16.04 Google Chrome, however.
I also get the "Uncaught Failed to get parent origin from URL hash!"
EDIT: After clearing cookies, i was able to get my primary Gmail user working. Still no luck on new users, but I'm guessing there's a problem on my end.
BHSPitMonkey commentedon Oct 11, 2018
I'm seeing this with a standard web site in Chrome 69.
beaukinstler commentedon Oct 11, 2018
As it might be easier for me, since I'm not dealing with anything in real production, I tried changing the client secrets, resetting the secret. That didn't change anything for me. I've also updated my domain ownership, as that wasn't done yet. Still the same problems. My app is now letting me log in, but it's supposed to also register new accounts in the DB when they don't exist, which isn't happening. Again, I suspect that's my fault, but I'll report back if I find otherwise.
beaukinstler commentedon Oct 11, 2018
my issue was related to some users not having a 'name' key come back from google. I'm not sure it has to do with scopes, or if it's even a new thing. I wonder if the recent Google+ problems sparked something about authorizations to access that key. I changed my logic to derive a name from the email address instead, and all is well for me.
sachinrekhi commentedon Oct 11, 2018
@grant any chance you could help bring this to the attention of the right folks at Google? This appears to be a regression introduced a few days ago causing Google sign-in to now fail in a variety of settings.
grant commentedon Oct 11, 2018
@bochunz Is there a recent gapi client change causing the above error?
BHSPitMonkey commentedon Oct 11, 2018
It's hard to tell if the offending change is in the gapi client or on the server, but there was definitely a regression this week. It's still happening to me, but it's sporadic.
boris-hocde commentedon Oct 12, 2018
Same issue on the example of https://developers.google.com/identity/sign-in/web/sign-in
Click on "Sign in" white button, in the middle of the page
When the Chrome dev tools is open, the popup is correctly loaded.
No issue when using ux_mode =
redirectinstead ofpopup.https://drive.google.com/open?id=1Qfv_aziyunwo0T7hi4rIPAl28RDH1-WE
potiuper commentedon Oct 12, 2018
Clicking on the "Sign in" button on the sign-in developer page works in Chromium, but not Firefox. Firefox returns the "uncaught exception: Failed to get parent origin from URL hash!" error.
mike-seekwell commentedon Oct 14, 2018
Building on @boris-hocde , this has "fixed" the issue for me, although I had to change several other things to make it work.
mike-seekwell commentedon Oct 14, 2018
@grant I second @sachinrekhi , we currently only offering sign in to our desktop app thru Google OAuth, so this issue is effectively shutting us down.
6 remaining items
yzhou88 commentedon Oct 16, 2018
Wow, I spent hours on this issue. I really want this bug to be fix asap.
syenchuk commentedon Oct 16, 2018
Thank you! I hope this will be fixed soon. Also breaks our SSO for Google users.
mike-seekwell commentedon Oct 16, 2018
@grant Any update here? Can they please just roll the change back until they figure out what's wrong.
aabuhijleh commentedon Oct 17, 2018
@sachinrekhi I've managed to get it working on Electron by setting
webPreferences.nativeWindowOpento true on the pop-up's parent BrowserWindow.Now it works as well as it's working on the website using Chrome.
mbellezi commentedon Oct 17, 2018
@sachinrekhi , in my case, I don't think i can use this solution. Anyone knows if there is a similar approach for the native Android PWA launcher?
rahulswimmer commentedon Oct 17, 2018
I have an angular 6 + PWA app that is consuming google login. I have implemented it using https://www.npmjs.com/package/angular-6-social-login.
I have started facing the same issue where pop goes blank and url is accounts.google.com/o/oauth2/iframe. In browser, this works just fine. I noticed that in browser when the google pop up appears, client id is being passed in it and when opened as a PWA, client id is not being passed and hence url for pop is not constructed. That might be one of the reason.
I don't see this as a node package issue. I request Google to resolve this issue at the earliest.
Also since i am using this package for google login, i cannot change popup to redirecturi. Hence i need a workaround in angular 6. Please suggest if any.
@adamazad can you suggest a workaround in angular 6 using the package i have used?
Thank You!
kongguibin commentedon Oct 17, 2018
The change that caused this issue has been rolled back. Can you guys verify if GSI works on PWA now?
grant commentedon Oct 17, 2018
Hi all,
The gapi team told me that this issue should be fixed, tested on iOS.
Can you please test on your environments and verify the fix?
sachinrekhi commentedon Oct 17, 2018
Awesome! Just verified that Google login once again works again in my Electron app.
mbellezi commentedon Oct 18, 2018
wima75 commentedon Oct 18, 2018
yes, now it works again. Thank you for fixing that.
vivek9716 commentedon Oct 18, 2018
yes, now it is working thanks.
kevglass commentedon Apr 15, 2020
Sadly this appears to be broken again on iOS 13.4.1
gordomo commentedon Aug 20, 2020
Hello there!
I'm working on a PWA, so, I was trying the PWA ios Wrapper (https://github.com/xtools-at/iOS-PWA-Wrapper)
The problem is that the Wrapped apps launch a popup windows (the google login one, but never finish load), and, the real google login pop up freeze after the user get logged in.(this when the user click on the google login button)
Maybe is related to this issue... can't tell... If anyone hears something please let me know!
Thanks!