Browser-agnostic Google OAuth 2
I need to allow the user to log in with his Google account, regardless of the browser he's using. I'm not using Firebase BTW
The issue is that Google's documentation (https://developer.chrome.com/docs/extensions/mv3/tut_oauth/#identity_permission) is not relevant to Edge, since Edge only allows https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/identity/launchWebAuthFlow
What am I missing?
1 Reply
The solution I came up with, thanks to https://www.phind.com/search?cache=a895cec9-7bb7-4f63-a327-cf34a2b43dc0, is:
1. Generate a permanent extension ID. If you have the ext in production, you can follow https://developer.chrome.com/docs/extensions/mv3/tut_oauth/#keep-consistent-id
2. Generate a client ID (https://console.cloud.google.com/apis/credentials)
3. While generating, use a redirect URI of
https://<ext_id>.chromiumapp.org
4. In the manifest, make sure to have
5. In the ext, e.g. popup:
If everything is executed correctly, data
should contain something like
Essentially, you'll have to use the auth code to make requests to Google's APIs