Azure-Samples / ms-identity-dotnetcore-maui

MAUI sample using MSAL library
MIT License
35 stars 14 forks source link

msal redirect to the app using B2C not working, but login screen opened in a new browser when localhost is set. #18

Open satyajit-behera opened 1 month ago

satyajit-behera commented 1 month ago

When I use the sample with required changes, it gives me the error: Only loopback redirect uri is supported, but msal{ClientId}://auth/ was found. Configure http://localhost or http://localhost:port both during app registration and when you create the PublicClientApplication object. See https://aka.ms/msal-net-os-browser for details

But when i set the loopback url as localhost, it opens up in a new browser window and loopback happens from there. Can we make it open within the same application windows in an MAUI application.

Thanks

DRAirey1 commented 1 month ago

Yes. Ran across the same thing with a WinUI application. I came here looking for a working example, only to find out that this example is broken as well. When I replaced the normal callback with the 'localhost' version, I got a system browser instead of the normal browser. That part was bad, but what is worse is the user flows are all messed up. I can't seem to create a new user, or link to external providers. There are some serious problems with the system browser aside from the user flows. 1.) The user can exit the system browser, leaving your application basically hung. 2.) Even if the login is successful, you get a useless message saying you can close the browser now. The flow is extremely confusing for new users.