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 accounts.google.com…”, with the URL being “https://accounts.google.co.uk/accounts/SetSID”. After about two minutes, the status changes to “Connecting to .extensions.allizom.org…”, 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: https://github.com/mdn/webextensions-examples/tree/master/google-userinfo

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

Thanks!


(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 extensions.allizom.org 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.