Skip to content

Cache Options

Bogdan Gavril edited this page Nov 16, 2021 · 3 revisions

Setting cache options

var app = ConfidentialClientApplicationBuilder.Create(ClientId)
               .WithCertificate(cert)                                                               
               .Build();

app.AppTokenCache.SetCacheOptions(CacheOptions.EnableSharedCacheOptions);
app.UserTokenCache.SetCacheOptions(CacheOptions.EnableSharedCacheOptions);

Cache options

EnableSharedCacheOptions - makes the cache static, so that it is shared between all instances of ConfidentialClientApplication

Getting started with MSAL.NET

Acquiring tokens

Web Apps / Web APIs / daemon apps

Desktop/Mobile apps

Advanced topics

FAQ

Other resources

Clone this wiki locally