Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
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

Closed

Description

@mbellezi

Greetings,

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?

Activity

  1. sachinrekhi commented on Oct 9, 2018

    @sachinrekhi

    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.

    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

  2. frankljbe commented on Oct 10, 2018

    @frankljbe

    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.

  3. BHSPitMonkey commented on Oct 11, 2018

    @BHSPitMonkey

    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.

  4. sachinrekhi commented on Oct 11, 2018

    @sachinrekhi

    @BHSPitMonkey are you experiencing the issue in an Electron app, mobile web view, or something else?

  5. beaukinstler commented on Oct 11, 2018

    @beaukinstler

    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.

  6. BHSPitMonkey commented on Oct 11, 2018

    @BHSPitMonkey

    I'm seeing this with a standard web site in Chrome 69.

  7. beaukinstler commented on Oct 11, 2018

    @beaukinstler

    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.

  8. beaukinstler commented on Oct 11, 2018

    @beaukinstler

    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.

  9. sachinrekhi commented on Oct 11, 2018

    @sachinrekhi

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

  10. grant commented on Oct 11, 2018

    @grant
    Contributor

    @bochunz Is there a recent gapi client change causing the above error?

  11. BHSPitMonkey commented on Oct 11, 2018

    @BHSPitMonkey

    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.

  12. boris-hocde commented on Oct 12, 2018

    @boris-hocde

    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 = redirect instead of popup.

    https://drive.google.com/open?id=1Qfv_aziyunwo0T7hi4rIPAl28RDH1-WE

  13. potiuper commented on Oct 12, 2018

    @potiuper

    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.

  14. mike-seekwell commented on Oct 14, 2018

    @mike-seekwell

    Building on @boris-hocde , this has "fixed" the issue for me, although I had to change several other things to make it work.

          auth2 = gapi.auth2.init({
          client_id: '123.apps.googleusercontent.com',
          scope: 'profile email',
          ux_mode: 'redirect',
          redirect_uri: 'https://www.abc.io/google_login_redirect'
        })
    
  15. mike-seekwell commented on Oct 14, 2018

    @mike-seekwell

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

  16. 6 remaining items

  17. yzhou88 commented on Oct 16, 2018

    @yzhou88

    Wow, I spent hours on this issue. I really want this bug to be fix asap.

  18. syenchuk commented on Oct 16, 2018

    @syenchuk

    I pinged an engineer at Google who made recent changes to gapi. I'll update here.

    Thank you! I hope this will be fixed soon. Also breaks our SSO for Google users.

  19. mike-seekwell commented on Oct 16, 2018

    @mike-seekwell

    @grant Any update here? Can they please just roll the change back until they figure out what's wrong.

  20. aabuhijleh commented on Oct 17, 2018

    @aabuhijleh

    @sachinrekhi I've managed to get it working on Electron by setting webPreferences.nativeWindowOpen to true on the pop-up's parent BrowserWindow.

    Now it works as well as it's working on the website using Chrome.

  21. mbellezi commented on Oct 17, 2018

    @mbellezi
    Author

    @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?

  22. rahulswimmer commented on Oct 17, 2018

    @rahulswimmer

    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!

  23. kongguibin commented on Oct 17, 2018

    @kongguibin

    The change that caused this issue has been rolled back. Can you guys verify if GSI works on PWA now?

  24. grant commented on Oct 17, 2018

    @grant
    Contributor

    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?

  25. sachinrekhi commented on Oct 17, 2018

    @sachinrekhi

    Awesome! Just verified that Google login once again works again in my Electron app.

  26. mbellezi commented on Oct 18, 2018

    @mbellezi
    Author
  27. wima75 commented on Oct 18, 2018

    @wima75

    yes, now it works again. Thank you for fixing that.

  28. vivek9716 commented on Oct 18, 2018

    @vivek9716

    yes, now it is working thanks.

  29. kevglass commented on Apr 15, 2020

    @kevglass

    Sadly this appears to be broken again on iOS 13.4.1

  30. gordomo commented on Aug 20, 2020

    @gordomo

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions