We're migrating our desktop software from using SMTP auth for email, to using modern auth. The application requests IMAP and SMTP permissions for an integrated email client.
We already have organization-based auth working using MSAL.NET, but even after configuring our application in Azure Portal, personal accounts fail to log in with an exception message which doesn't help.
Here is the configuration on portal.azure.com: 
Here is the creation code using MSAL.NET (in VB)
Dim brokerOptions As New BrokerOptions(BrokerOptions.OperatingSystems.Windows) clientApp = PublicClientApplicationBuilder _ .Create(ClientID) _ .WithWindowsDesktopFeatures(brokerOptions) _ .WithAuthority(AadAuthorityAudience.AzureAdAndPersonalMicrosoftAccount) _ .Build() And then when we need interactive login, we call this:
ar = Await ClientApp.AcquireTokenInteractive(Scopes) _ .WithAccount(firstAccount) _ .WithParentActivityOrWindow(handle) _ .WithPrompt(Prompt.SelectAccount) _ .ExecuteAsync() When we use an organization Microsoft 365 account, it works fine. But when we try to log in with a personal outlook.com/live.com/hotmail.com account it fails with the following error, before asking for the password/MFA:
WAM Error Error Code: 2156265473 Error Message: ApiContractViolation WAM Error Message: (pii) Internal Error Code: 557973635 Possible causes: - Invalid redirect uri - ensure you have configured the following url in the application registration in Azure Portal: ms-appx-web://microsoft.aad.brokerplugin/<OUR APP CLIENT ID> Note that the above error says the "possible" cause may be an invalid redirect uri. This is not the real reason because the redirect uri was copy/pasted into the app configuration. Also, it works fine for organization logins, so the redirect uri can't be the issue.
I'm not sure what else could be the problem.

