question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[handled] SerializationException within AcquireTokenSilentAsync when updating from Msal 1.x to Msal 2.x

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
stevehurcombecommented, Nov 6, 2018

@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!

0reactions
jennyf19commented, Nov 6, 2018

@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. 😸

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found