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.

[Feature Request] In memory token cache in confidential client application is well partitioned for all flows, non longer serialized and can be shared between instances of confidential client apps

See original GitHub issue

Is your feature request related to a problem? Please describe. For context see Token cache vision 1-pager

Describe the solution you’d like Out of the box, confidential client applications should internally have a token cache which is:

P1:

ConfidentialClientApplicationBuilder.Create(clientId)
                                                          .WithDefaultCache(shared: true) // Shares the cache between instances of CCA

P2:

ConfidentialClientApplicationBuilder.Create(clientId)
                                                          .WithDefaultCache(shared: false,
                                                           new EvictionParameters(sizeSimit:1000,
                                                                                                  slidingExpiration: TimeSpan.FromMinutes(30) )
                                                          );

Describe alternatives you’ve considered see Token cache vision 1-pager

Additional context This issue overrides:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jmprieurcommented, Sep 22, 2021

@zhenyar. I think that this was defensive code due to the fact that ADAL’s cache had not initially been designed to support some scenarios. You shouldn’t need to do any of that with MSAL. I would recommend you just delete this code.

0reactions
zhenyarcommented, Sep 29, 2021

When is the default cache support expected to be available in Microsoft.Identity.Client? Will the default cache support multi-tenant OBO, username/password and client credentials auth flows?

Unfortunately Microsoft.Identity.Web.TokenCache is not going to work for me due to nuget hell.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Token cache serialization (MSAL.NET) - Microsoft Entra
Public client applications (desktop and mobile apps) should try to get a token from the cache before acquiring a token by another method....
Read more >
Acquire and cache tokens with Microsoft Authentication ...
Instantiate a confidential client application with a token cache with customized serialization. Acquire the token using the authorization code ...
Read more >
netFramework/Microsoft.Identity.Client.xml 3.2.0
This information is used for token cache lookup and enforcing the user session on the STS authorize endpoint. ... The same account can...
Read more >
JAX-RS OAuth2 - Apache CXF
The client requests an access token from OAuth2 Access Token Service by ... INFO: Setting an instance of "org.apache.cxf.rs.security.oauth2.common.
Read more >
All Classes and Interfaces (Java SE 20 & JDK 20)
This class provides a skeletal implementation of the List interface to minimize the effort required to implement this interface backed by a "sequential...
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