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
(if you go again through these steps make sure the cache is deleted from the bin\debug folder)
Run the App
sign in with a social identity (for example Google or Microsoft)
call the API (if you want)
Sign out
Sign-in again with a different social identity
Expected behavior
you are signed in with the new identity
Actual behavior
the cache returns an exception Error Acquiring Token: Microsoft.Identity.Client.MsalServiceException: Returned user identifier does not match the sent user identifier at Microsoft.Identity.Client.Internal.Requests.RequestBase.SaveTokenResponseToCache() at Microsoft.Identity.Client.Internal.Requests.RequestBase.PostTokenRequest() at Microsoft.Identity.Client.Internal.Requests.RequestBase.<RunAsync>d__35.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Identity.Client.PublicClientApplication.<AcquireTokenForUserCommonAsync>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Identity.Client.PublicClientApplication.<AcquireTokenAsync>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at active_directory_b2c_wpf.MainWindow.<SignInButton_Click>d__1.MoveNext() in C:\ghs\s\active-directory-b2c-dotnet-desktop\active-directory-b2c-wpf\MainWindow.xaml.cs:line 39 ErrorCode: user_mismatch StatusCode: 0 Claims:
Analysis
If you run it under debugger, you'll notice that there is an exception in CacheFallbackOperations.RemoveAdalUser because the displayableId is null
System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=Microsoft.Identity.Client StackTrace: at Microsoft.Identity.Core.Cache.CacheFallbackOperations.RemoveAdalUser(ILegacyCachePersistance legacyCachePersistance, String displayableId, ISet`1 environmentAliases, String identifier) in C:\gh\adal.net\core\src\Cache\CacheFallbackOperations.cs:line 186
this exception is logged, and does not prevent the cache from being serialized.
The text was updated successfully, but these errors were encountered:
Which Version of MSAL are you using ?
MSAL.NET 2.0.1-internal25504dev (Sept 12th, hotfix release candidate)
Which platform has the issue?
All
What authentication flow has the issue?
Repro
Expected behavior
you are signed in with the new identity
Actual behavior
the cache returns an exception
Error Acquiring Token: Microsoft.Identity.Client.MsalServiceException: Returned user identifier does not match the sent user identifier at Microsoft.Identity.Client.Internal.Requests.RequestBase.SaveTokenResponseToCache() at Microsoft.Identity.Client.Internal.Requests.RequestBase.PostTokenRequest() at Microsoft.Identity.Client.Internal.Requests.RequestBase.<RunAsync>d__35.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Identity.Client.PublicClientApplication.<AcquireTokenForUserCommonAsync>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Identity.Client.PublicClientApplication.<AcquireTokenAsync>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at active_directory_b2c_wpf.MainWindow.<SignInButton_Click>d__1.MoveNext() in C:\ghs\s\active-directory-b2c-dotnet-desktop\active-directory-b2c-wpf\MainWindow.xaml.cs:line 39 ErrorCode: user_mismatch StatusCode: 0 Claims:
Analysis
If you run it under debugger, you'll notice that there is an exception in CacheFallbackOperations.RemoveAdalUser because the displayableId is null
System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=Microsoft.Identity.Client StackTrace: at Microsoft.Identity.Core.Cache.CacheFallbackOperations.RemoveAdalUser(ILegacyCachePersistance legacyCachePersistance, String displayableId, ISet`1 environmentAliases, String identifier) in C:\gh\adal.net\core\src\Cache\CacheFallbackOperations.cs:line 186
this exception is logged, and does not prevent the cache from being serialized.
The text was updated successfully, but these errors were encountered: