AzureAD / microsoft-authentication-library-for-java

Microsoft Authentication Library (MSAL) for Java http://aka.ms/aadv2
MIT License
284 stars 142 forks source link

Review all samples to ensure token caching is used #698

Open bgavrilMS opened 1 year ago

Avery-Dunn commented 1 year ago

The only sample which still shows the bad pattern of 'make client app -> acquire token -> destroy client app' is device code flow here, all others were fixed some time ago.

However, while only that sample shows 'terrible' cache use, pretty much none of the samples demonstrate good cache use with a good explanation of why the samples do what they do. This is a very critical component for all but the simplest applications, and deserves a lot of attention in samples.

So, action items are probably:

bgavrilMS commented 1 year ago

I would propose the following:

  1. Update public client samples to use the public client token cache.
  2. Add the "shared token cache" option to MSAL 4J and update client_creds samples to use that
  3. Update the web app and web api to use Google Guava cache I created.