microsoft-authentication-library-for-dotnet: [Bug] "email" scope forces token refresh even if there are valid cached tokens

MSAL 4.7.1 net45

  • Desktop / Mobile
    • Interactive
    • Integrated Windows Auth
    • Username Password
    • Device code flow (browserless)

I use the following code to initialize IPublicClientApplication:

var client = PublicClientApplicationBuilder.Create(strClientId).Build();

Where the implemetnation of UserTokenCache.EnableSerialization() is taken from here:

Then I get a token multiple times using this line:

var authResult = await client.AcquireTokenSilent(new string[] {strCustomScope, "email"}, cachedTokenAccount).ExecuteAsync()

I get new tokens every time, even if I have valid (not expired) tokens in the cache. Because of that I get error introduced by this update:

Removing “email” scope fixes this and I get tokens from the cache if not expired.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (17 by maintainers)

Most upvoted comments

@bgavrilMS @henrik-me @jennyf19 @trwalke @neha-bhargava Give it’s external we might want to close it with a link from FAQs ? do you agree?