browser.identity.launchWebAuthFlow hangs after authentication

(Michael Williamson) #1

When using browser.identity.launchWebAuthFlow with Google OAuth, everything works fine except that once I’ve authenticated with Google, the window that was used for auth hangs. The status is “Waiting for…”, with the URL being “”. After about two minutes, the status changes to “Connecting to…”, and about a minute after that, the window closes and fulfils the promise from browser.identity.launchWebAuthFlow.

If I close the window manually once I’ve authenticated with Google, it seems authentication still succeeded since the next call to browser.identity.launchWebAuthFlow works without a prompt.

This happens with the google-userinfo sample:

If anybody has any ideas what the cause is or how to fix it, that’d be much appreciated.


(Martin Giger) #2

That seems like an issue with the google oAuth flow and not Firefox, where google is taking a long time to redirect you.

(Michael Williamson) #3

It feels more like an issue with Firefox, as though it’s actually trying to connect to rather than intercepting the redirect (which is what I assume is meant to happen, since trying to access the redirect URL results in a connection failure). Using the same flow with other redirect URLs works without an issue.

Having said that, I’m by no means an expert on how the flow is meant to work inside in a web extension, so happy to be corrected.

(Panos) #4


I am facing the same issue, have you had the chance to find a workaround?

I am tempted to set the interactive flag to false so that the prompt to authenticate never appears, and add a notification that Signing in with Google only works if the user is already authenticated.

(Michael Williamson) #5

No, I haven’t found a workaround I’m afraid.

(Kirlat) #6

We’re experiencing the same issue too. There is an open issue about this on Bugzilla, FYI.

An advise by Shane Caraveo to change the pref extensions.webextensions.identity.redirectDomain to use, even though probably not a real solution, made it work.

(Greg Kochaniak) #7

I faced a similar problem when starting launchWebAuthFlow() from a script loaded from the extension popup window HTML code. The problem went away when I changed to calling it from a background script. Maybe this will help someone.