Skip to content

Commit 9102f13

Browse files
authored
Update msal-net-token-cache-serialization.md
1 parent b758c6f commit 9102f13

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

articles/active-directory/develop/msal-net-token-cache-serialization.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,11 @@ Instead of `app.AddInMemoryTokenCache();` you can use different caching serializ
233233
<a id='no-token-cache-serialization' />
234234
#### Token Cache without serialization
235235

236-
You can specify that you don't want to have any token cache serialization and rely on MSAL.NET internal cache. :
236+
You can specify that you don't want to have any token cache serialization and rely on MSAL.NET internal cache:
237237
- Use `.WithCacheOptions(CacheOptions.EnableSharedCacheOptions)` when you build the application.
238238
- Don't add any serializer.
239239

240240

241-
242241
```CSharp
243242
// Create the confidential client application
244243
app= ConfidentialClientApplicationBuilder.Create(clientId)
@@ -249,7 +248,7 @@ You can specify that you don't want to have any token cache serialization and re
249248
.WithAuthority(authority)
250249
.Build();
251250
```
252-
\
251+
253252
`WithCacheOptions(CacheOptions.EnableSharedCacheOptions)` makes the internal MSAL token cache to be shared between different MSAL client application instances. This is faster than using any token cache serialization, however, the internal in-memory token cache does not have eviction policies. Existing tokens will be refreshed in-place, but fetching tokens for different resources, users, tenants, etc. will make the cache grow accordingly. If you use this approach and have a lot of users/tenants, make to sure to monitor the memory footprint and if it becomes an issue, consider enabling token cache serialization which can reduce the internal cache size. Additionally, be aware that these two features, shared cache and cache serialization, are not currently supported toghter.
254253

255254
#### In memory token cache

0 commit comments

Comments
 (0)