Skip to content

[Bug] Maui Essentials WebAuthenticator not working in WinUI #2702

@ElliottBrand

Description

@ElliottBrand

I'm attempting to use WebAuthenticator in Maui Essentials to authenticate a WinUI project, but it's having an issue finding the manifest file. It throws an exception saying:

Could not find file 'C:\WINDOWS\system32\AppxManifest.xml'.

If I add a local version of https://github.com/dotnet/maui/blob/main/src/Essentials/src/WebAuthenticator/WebAuthenticator.uwp.cs into my project (I made PlatformAuthenticateAsync public to test it and just passed the url and callbackUrl in the WebAuthenticatorOptions) and adjust line 51 to:

var doc = XDocument.Load($"{AppDomain.CurrentDomain.BaseDirectory}AppxManifest.xml", LoadOptions.None);

It then finds the file, however, a new error is thrown that says:

System.Runtime.InteropServices.COMException: 'There are no remote procedure calls active on this thread. (0x800706BD)'

Additionally, I set the CallbackUrl to:

new Uri("io.identitymodel.native://callback")

and the Url to:

new Uri("https://demo.identityserver.io")

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-essentialsEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App Infop/1Work that is important, and has been scheduled for release in this or an upcoming sprintplatform/windowss/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions