microsoft-authentication-library-for-dotnet: MSAL does not pass the prompt to WAM (was: WAM signout with RemoveAsync and signin with WithPrompt(Prompt.ForceLogin) does not ask password)
Which version of MSAL.NET are you using? MSAL.NET 4.53.0
Platform .NET 4.8 (Winforms)
What authentication flow has the issue?
- Desktop / Mobile
- [*] Interactive
- Integrated Windows Authentication
- Username Password
- Device code flow (browserless)
- Web app
- Authorization code
- On-Behalf-Of
- Daemon app
- Service to Service calls
Other?
Is this a new or existing app? This is a new app
//signout:
var accounts = await MyAuthentication.Pca.GetAccountsAsync();
if (accounts.Any())
{
await MyAuthentication.Pca.RemoveAsync(accounts.FirstOrDefault());
Logger.LogDebug($"User: {accounts.FirstOrDefault().Username} signed out!");
}
//signin:
authResult = await Pca.AcquireTokenInteractive(scopes).WithPrompt(Prompt.ForceLogin)
.ExecuteAsync()
.ConfigureAwait(false);
Expected behavior I expected, that user is signed out and after requesting new token with AcquireTokenInteractive, the pop-up windows opens, where user can be chosen. After user (e-mail) is chosen, the user should again enter password.
Actual behavior I expected, that user is signed out and after requesting new token with AcquireTokenInteractive, the pop-up windows opens, where user can be chosen. After user (e-mail) is chosen, the user is signed in without entering a password. Also after manual deleting cache file, user is automatically logged in. This behavior is the same for two different logins, on same desktop pc, where the password was entered only one time.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 15 (5 by maintainers)
We haven’t been able to fully resolve this issue either, as the underlying bug is still present. However, we had a similar requirement and found a workaround that might help.
We configured our application to initiate a request to a specific page on our website. This page redirects the user to the Microsoft login screen using the Azure AD API, where we can enforce a sign-in every time. After the user completes the login, the page returns a response indicating whether the user successfully authenticated or not. Our application then reads this response to determine the login status and proceeds accordingly.
Sorry for the delay in raising a bug about the prompt to WAM. It seems this issue is now tracking it, so attaching the convo here: https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues/4110#issuecomment-1530955885
Possibly. Today, MSAL does not pass on the Prompt option to WAM. That’s a bug. We can get that fixed but I don’t know what WAM behavior will be like.
WAM not displaying the 3 dots will not be easy to change.