question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebAuthenticator not working with Mozilla Firefox

See original GitHub issue

Hi,

I am using your WebAuthenticator for authenticating a MAUI windows app. The authenticator works correctly with edge and chrome browsers. But when I set Mozilla as default browser, the browser opens, accepts login credentials, brings the app in the foreground but the control is never returned to the MAUI app.

On Debugging the WebAuthenticator.cs I found this:-

   // WebAuthenticator.cs
    tasks.Add(taskId, tcs);
    var uri = await tcs.Task.ConfigureAwait(false);

Here, the control never returns to the last line after the second last is executed.

Using with Windows 11 and Firefox 111.0.1 (64-bit).

Issue Analytics

  • State:open
  • Created 5 months ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
RobinS-Scommented, Jun 25, 2023

@dotMorten @shv07 @oliverholliday I’ve tested it out a bit, and found out it is indeed a Firefox problem. Fixing this in your code would be nice to get something working fast, but I agree they should fix it. Reported it at Bugzilla.

2reactions
benny-ayotecommented, May 5, 2023

I experienced the same issue. The quotation marks expected in the JSON string value of the state parameter are being removed by Firefox. This did not occur in Chrome.

Firefox: https://[URL]/auth?redirect=myapp://&state={appInstanceId:",signinId:6fc43c2c-7df7-443d-ba11-4e37e4aa9a4b}

Chrome: https://[URL]/auth?redirect=myapp://&state={"appInstanceId":"","signinId":"2739798f-d690-4426-abcf-4f1a9dce3ea6"}

As a result, the call to JsonObject.Parse(state) throws an exception due to the improperly formed JSON.

// WebAuthenticator.cs
var jsonObject = System.Text.Json.Nodes.JsonObject.Parse(state) as JsonObject;
if (jsonObject is not null)
...

I was able to resolve by changing this:

query["state"] = stateJson.ToJsonString();

to this:

query["state"] = Uri.EscapeDataString(stateJson.ToJsonString());
Read more comments on GitHub >

github_iconTop Results From Across the Web

Signing in to Firefox requires an authentication app that I ...
Hello, My problem is this: Whenever I try to sign in to my Firefox account, it asks me to enter a security code...
Read more >
What if I'm locked out of Two-Step Authentication? | Firefox ...
If you're using Google Authenticator, tap on the three-dot menu, Settings, Time correction for codes, and then Sync now. All authenticator apps depend...
Read more >
firefox two-step authentication always fail because of ...
I am keeping trying to set up a two-step verify on my firefox account, but stuck on the last step of input the...
Read more >
How to set up Authenticator on another device | Firefox ...
Chosen solution. You probably need to disable 2FA on your Firefox account and then re-enable 2FA and setup the Authenticator on the new...
Read more >
Web Authentication API - MDN Web Docs - Mozilla
The Web Authentication API (WebAuthn) is an extension of the Credential Management API that enables strong authentication with public key ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found