1

I have a VSTO plugin and I want users to log in with AAD so it can access downstream services but to reduce the number of login prompts I would like to cache the refresh token in Windows credential manager.

I believe ADAL v3 doesn’t allow refresh tokens to be accessed so I would appreciate any advice on how this might be achieved. Is there a token cache that wraps accessing the credential manager in Windows?

MattCowen
  • 165
  • 8

1 Answers1

1

ADAL v3 .NET saves refresh tokens in its in-memory cache. If you want to have them persisted, you can save the entire cache by providing a custom cache class that saves it as a blob in whatever storage you choose, including the cred manager (tho the challenge there is that you need to shard the cache to deal with the fixed length of the credman entries). See the client portion of https://github.com/Azure-Samples/active-directory-dotnet-native-desktop

vibronet
  • 7,364
  • 2
  • 19
  • 21