3

We have a chrome extension that runs on Chromium edge and Chrome browser. Before today it was working all fine but today it starts crashing the Microsoft Edge after calling the API and while debugging we see the error comes from this API :

https://developer.chrome.com/docs/extensions/reference/identity/#method-launchWebAuthFlow

We use this API for auth and Microsoft also states that we can use this API. The below message is from the Microsoft channel :

chrome.identity.getAuthToken - As an alternate, you may use launchWebAuthFlow to fetch an OAuth2 token to authenticate users.

The issue is only coming with the edge browser. Edge Version : 96.0.1054.41 (Official Build) (64-bit) We also tried to downgrade the edge but nothing seems to be working.

We use Google and Microsoft login and launchwebauthflow is failing only on Microsoft login, the auth URI we are using: https://login.microsoftonline.com/common/oauth2/authorize

We are passing all the required parameters and the call is made from the background script.

MKJ
  • 3
  • 1
sobby01
  • 1,916
  • 1
  • 13
  • 22
  • Which version of the Edge you used? You mentioned that it worked normally before today. I recommand that you could roll back Edge to the previous version to test whether it is a problem with Edge itself. Just refer to this [rollback doc](https://learn.microsoft.com/en-us/deployedge/edge-learnmore-rollback). By the way, does this issue occour in Chrome as well? – Xudong Peng Dec 02 '21 at 08:21
  • Yeah, so the version of the Edge is : 96.0.1054.41 (Official build) (64-bit) and we tried the older version, even beta version as well, we tried the same on Chrome and it's working absolutely fine. We use Google and Microsoft login, Google login is working fine but for Microsoft it is crashing – sobby01 Dec 02 '21 at 08:26
  • we use following auth url : https://login.microsoftonline.com/common/oauth2/authorize – sobby01 Dec 02 '21 at 08:28
  • I come from the thread on the Microsoft forum. For me it's not only the extension, but the Edge browser itself that crashes randomly. I attach the post link for a better description of my problem: https://techcommunity.microsoft.com/t5/discussions/edge-stable-crashing-on-extension-function-chrome-identity/m-p/2904069/highlight/true#M50468 – diridev Dec 02 '21 at 14:41
  • @diridev, in my case also as soon as we initiate the call for login using launchWebAuthFlow API it crashes the browser. – sobby01 Dec 02 '21 at 14:46
  • @sobby01 yeah exactly, the browser crashes as soon as the function call is made. Since I wrote the post, I also experienced the problem on fresh installations, not only installations due to the synchronization. Sometimes it works, some other not. It's an RNG fiesta. – diridev Dec 02 '21 at 15:27
  • Still unresolved in the latest beta release (Version 97.0.1072.28) – Matt King Dec 09 '21 at 13:59
  • It's now fixed in Edge Version 98.0.1108.43 – Blig Feb 05 '22 at 13:01

1 Answers1

0

We have finally changed the call and used chrome.windows.create api to initiate the authentication request

return await global.chrome.windows.create({
    focused: true,
    height : 800,
    width: 800,
    url: authURL
})

We listened to the chrome page URL change and parse the token from the redirect URI and create a local token for the APIS.

Here authurl is the same which we used for launchWebAuthFlow

sobby01
  • 1,916
  • 1
  • 13
  • 22
  • This is more of a workaround than a solution to the problem though – diridev Dec 02 '21 at 18:54
  • It looks like you have found an alternative solution. You can mark your answer as an accepted answer after 48 hrs, when it is available to mark. It can help other community members in future in similar kind of issues. Thanks for your understanding. – Xudong Peng Dec 03 '21 at 06:34
  • @diridev yeah, because we couldn't sit idle as our customers were not able to login using Microsoft auth flow. We had to provide an alternate solution. – sobby01 Dec 04 '21 at 15:44
  • We had no idea when Microsoft will fix this issue. – sobby01 Dec 04 '21 at 16:20
  • 3
    @sobby01 yeah I understand. I just had to point that out to let other users know the original problem is still unsolved. For the same reason I wouldn't have marked it as the accepted answer. – diridev Dec 04 '21 at 16:46