Trying to run a basic Azure AD B2C authentication from a Native App. I followed the WPF App registration guidance, and am using extract from the code provided in the Git Hub example.
Using the Microsoft.Identity.Client SDK, when I run await app.AcquireTokenInteractive(App.ApiScopes).ExecuteAsync();, I get the following exception:
Microsoft.Identity.Client.MsalClientException: 'The browser based authentication dialog failed to complete. Reason: The server has not found anything matching the requested URI (Uniform Resource Identifier).'
I run this from an test with NUnit.net
I did the following tries and checks:
Tried the recommended URI:
https://mytenanturl.com.b2clogin.com/oauth2/nativeclientTried a custom URI such as
https://mytenanturl.com/test/auth/nativeclientTried a custom URI such as
uri://mytenanturl.com/test/auth/nativeclientTried one of the 3 URIs pre-registered by default on Azure:
https://login.microsoftonline.com/common/oauth2/nativeclientTried with a local URI such as
https://127.0.0.1/dev/These URIs are all registered on the Azure
Portal / App Registration / Authentication, withPlatform Configurationset toMobile and desktop applicationsIn the App Regsitration Manifest, it says
"replyUrlsWithType": [ { "url": "https://127.0.0.1/dev", "type": "InstalledClient" }, { "url": "https://login.microsoftonline.com/common/oauth2/nativeclient", "type": "InstalledClient" }, etc,
When I inspect the
IPublicClientApplicationobject, I can see the URI correctly inclued within.AppConfig.RedirectUri. However,PublicClientApplication.RedirectUrisays it is Null. I am confused beause I cannot even understand where this property is comming from, since it does not appear in the documentation, wherePublicClientApplication Classor its parent classes have noRedirectUriproperty.
What am I doing wrong?