[handled] SerializationException within AcquireTokenSilentAsync when updating from Msal 1.x to Msal 2.x
See original GitHub issueWhich 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
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Understanding the AcquireTokenAsync API
Learn how to acquire tokens silently in public and confidential client applications using MSAL.NET.
Read more >MSAL 2.x returns existing authentication result for a ...
We ran into an issue with the Single sign-on-configuration set to Application. It seems that when logging out (and we are policy based)...
Read more >MSAL.PS
In MSAL 1.x, return a user from its identifier. From MSAL 2.x, use <see cref="M:Microsoft.Identity.Client.ClientApplicationBase.GetAccountsAsync"/> instead.
Read more >Microsoft Authentication Library for JavaScript (MSAL.js)
Start using msal in your project by running `npm i msal`. ... are going to bring our msal-angular library with the latest 1.x...
Read more >Using MSAL.js to integrate React Single-page applications ...
This month's in -depth topic: Deep dive on using MSAL.js to integrate React Single-page applications with Azure Active Directory.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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!
@stevehurcombe Thanks for the update…i’m glad you opened the issue as well. Please do so again if you run into any other issues. Glad you’re unblocked. 😸