microsoft-authentication-library-for-dotnet: [handled] SerializationException within AcquireTokenSilentAsync when updating from Msal 1.x to Msal 2.x
Which Version of MSAL are you using ? Microsoft.Identity.Client (NuGet) 2.3.1-preview
Which platform has the issue? xamarin.android
What authentication flow has the issue? [*] Xamarin.Android
What is the identity provider ? [*] Azure AD B2C
If B2C, what social identity did you use? Google
Repro I’m getting an exception on this line:
AuthenticationResult ar = await App.PCA.AcquireTokenSilentAsync(App.Scopes, firstAccount);
Actual behaviour Exception:
System.Runtime.Serialization.SerializationException: Required members Microsoft.Identity.Core.Cache.MsalAccessTokenCacheItem in type ‘environment, home_account_id, credential_type, secret, cached_at, target’ are not found. occurred
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (1 by maintainers)
@jennyf19 Not since I added
android:allowBackup="false"
to my project. I think you’re right about the old cached token and it kept coming back because for some reason Visual Studio deployments were triggering a restore of local storage. I’m glad I raised the issue though, it’s something to be aware of. Something for the Visual Studio to team to look into disabling on debug deployments!If the problem comes back I’ll raise the issue again.
Thanks for your help!