Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Setting cache options
var app = ConfidentialClientApplicationBuilder.Create(ClientId)
.WithCertificate(cert)
.Build();
// The App token cache is used by `AcquireTokenForClient`, which gets tokens on behalf of service principals
app.AppTokenCache.SetCacheOptions(CacheOptions.EnableSharedCacheOptions);
// The User token cache is used by all other AcquireToken* methods, which get tokens on behalf of users
app.UserTokenCache.SetCacheOptions(CacheOptions.EnableSharedCacheOptions);
Cache options
EnableSharedCacheOptions
- makes the cache static, so that it is shared between all instances of ConfidentialClientApplication
.