1
votes

I have a problem when I close the sign in Dialog from msal with the right upper close button (red x), which I get from the call of AcquireTokenAsync(scope).

The problem is, I get a valid result from AcquireToken, the result is the same which i get from a login before.

Detail: I sign in with an account from active directory b2c. works. Then log out, clear cookies and token cache also delete user from PublicClientApplication.Users. Log in again, The AcquireTokenSilent throws a MsalUiRequiredException as expected, with AcquireToken the SignIn-Dialog opens, i can now choose the account which I signed in before, (but I cleared all, strange), when i then remove the account (the three dots, in the right upper corner from the login-dialog) and say then cancel, I get null as result, but when closing the sign in dialog, I get the same result as when i normal sign in.

Is this a normal behaviour, because the account from last login is somewhere saved and i have to remove them, or miss I something else?

I use the MSAL 1.1.0-preview version, in an Desktop WPF app. Also with an own TokenCache, but these deletes every sign out the saved information.

thanks dstreissi

1

1 Answers

0
votes

I figured it out, the msal works as expected, I used the code sample from Azure-Samples/active-directory-dotnet-desktop-msgraph-v2. There is a try-catch around the AcquireToken. These catch a MsalException. If you cancel, the AcquireToken throws a MsalException. I catched it and newer throw it again.

For the same AuthenticationResult, I forgot to reset it.

So msal 1.1.0-preview works fine for me now.