chrome.identity.launchWebAuthFlow issue on macOS

336 views
Skip to first unread message

Sachith Anuranga

unread,
Sep 27, 2024, 10:23:35 AM9/27/24
to Chromium Extensions

I am working on a Chrome extension that uses the chrome.identity.launchWebAuthFlow API in interactive mode for the authentication process. The chrome.identity API opens a popup with the OAuth2 URL for the user to enter their login credentials. Afterward, I use the authentication response to log the user into the system.

This process works fine on the Windows operating system. However, on macOS, I am encountering an issue. When the user completes the login process in the authentication popup, the extension also closes automatically. This seems to be a issue in Chrome on macOS.

When I perform the same steps with the developer console open, the login process works as expected, and the extension does not close automatically.

I could resolve this issue by using an alternative solution (such as a background.js file), but I need to know if there are any additional configurations required specifically for macOS.

Patrick Kettner

unread,
Oct 14, 2024, 4:37:03 PM10/14/24
to Sachith Anuranga, Chromium Extensions
Hi Sachith,
When you say "the extension closes automatically", do you mean the extension's popup? If not, would you be able to elaborate on what you mean?

patrick

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/493ff581-b82e-4311-a6e4-98324cf25b74n%40chromium.org.

Sachith Anuranga

unread,
Oct 15, 2024, 2:13:57 AM10/15/24
to Chromium Extensions, Patrick Kettner, Chromium Extensions, Sachith Anuranga
Hi Patrick,

yes, the extension popup is closed with the authentication popup. Also the extension code is not capturing the  authentication  result as well. For macOS, I had to use a background service worker to process the  authentication .
On Windows everything works fine. 

Stephen S.

unread,
Oct 15, 2024, 8:22:21 AM10/15/24
to Chromium Extensions, Sachith Anuranga, Patrick Kettner, Chromium Extensions
Not sure if this will help, but I wrote up some posts on implementing chrome.identity.launchWebAuthFlow. I've used this across Mac/Windows, etc. 
  1. Configuring chrome.identity.launchWebAuthFlow for Google Sign In in the extension

  2. Handling Google OAuth Authorization Code and Access Token Exchange in a Chrome Extension

  3. Handling Google OAuth Refresh Tokens in a Chrome Extension

Sharing just in case it helps in one area or another.

- Stephen

Reply all
Reply to author
Forward
0 new messages