You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The app is in production, and I have upgraded to a new version of MSAL
Issue description and reproduction steps
When using MSAL's PublicClientApplicationBuilder with WAM via .WithBroker() and running as Administrator, AcquireTokenInteractive() immediately fails with an error saying the user closed the interactive session. The WAM account selection dialog often pops up, but often the console running the application will lose focus and is no longer responsive to the user's mouse or keyboard input.
When a token is already present for the user, AcquireTokenSilent() is successful, even when running as Administrator.
Relevant code snippets
// Happy to provide a sample project that reproduces the issue with internal Microsoft identitiesIPublicClientApplicationpublicApp=PublicClientApplicationBuilder.Create(settings.ApplicationId).WithAuthority(settings.AuthorityUri).WithParentActivityOrWindow(GetConsoleOrTerminalWindow).WithBroker(newBrokerOptions(BrokerOptions.OperatingSystems.Windows){ListOperatingSystemAccounts=true,}).WithDefaultRedirectUri().WithLogging((level,message,containsPii)=>{// logging},Microsoft.Identity.Client.LogLevel.Verbose,enablePiiLogging:true).Build();varaccounts=awaitpublicApp.GetAccountsAsync();AuthenticationResultresult=null;foreach(varacctinaccounts){try{result=awaitpublicApp.AcquireTokenSilent(scopes,acct).ExecuteAsync();}catch(MsalUiRequiredException){// don't interact here}if(result!=null)break;}try{if(result==null){result=awaitpublicApp.AcquireTokenInteractive(scopes).ExecuteAsync();}}catch(MsalClientExceptionex){// logging}
Expected behavior
When a valid account+token is not availabe in the accounts list, I expect AcquireTokenSilent() to fail for all enumerated accounts. When running as Administrator, I expect AcquireTokenInteractive() to engage with the WAM broker to pop up an account selection dialog while the code blocks on the user interact. Instead, the dialog is sometimes shown, but the interop with WAM immediately returns:
[RuntimeBroker] Could not sign in interactively. Status: UserCanceled Context: User cancelled the Accounts Control Operation. Tag: 0x1f7d734a
Identity provider
Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
Regression
No response
Solution and workarounds
Current work-around is to not use WAM broker when running as Administrator.
The text was updated successfully, but these errors were encountered:
@ashok672Microsoft.Identity.Client.Broker should be updated with new dependency?
That is how we are pulling in Microsoft.Identity.Client.NativeInterop.
Currently that is depending on 0.16.1
Library version used
4.63.0
.NET version
net8.0
Scenario
PublicClient - desktop app
Is this a new or an existing app?
The app is in production, and I have upgraded to a new version of MSAL
Issue description and reproduction steps
When using MSAL's
PublicClientApplicationBuilder
with WAM via.WithBroker()
and running as Administrator,AcquireTokenInteractive()
immediately fails with an error saying the user closed the interactive session. The WAM account selection dialog often pops up, but often the console running the application will lose focus and is no longer responsive to the user's mouse or keyboard input.When a token is already present for the user,
AcquireTokenSilent()
is successful, even when running as Administrator.Relevant code snippets
Expected behavior
When a valid account+token is not availabe in the accounts list, I expect
AcquireTokenSilent()
to fail for all enumerated accounts. When running as Administrator, I expectAcquireTokenInteractive()
to engage with the WAM broker to pop up an account selection dialog while the code blocks on the user interact. Instead, the dialog is sometimes shown, but the interop with WAM immediately returns:Identity provider
Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
Regression
No response
Solution and workarounds
Current work-around is to not use WAM broker when running as Administrator.
The text was updated successfully, but these errors were encountered: