[Feature Request] Persist tokens cache between app restart for local development with `dotnet watch`
See original GitHub issueIs your feature request related to a problem? Please describe.
Default template come with AddInMemoryTokenCaches
, that throw exception every time when server restart and browser with old cookies tries to load the page (in my case it is Blazor Server application)
Describe the solution you’d like I would like to have a simple solution to persist cache between app restart for local development. It should be included in default template and just works.
Maybe it is possible with cross platform lightweight DB like (like LocalDB or SQLite) and AddDistributedSqlServerCache
.
Describe alternatives you’ve considered
I wrote a post how to implement custom IDistributedCache
that persist cache in local json file and how to register it for development environment only.
https://sergeytihon.com/2021/04/05/dotnet-watch-with-microsoft-identity-web-or-custom-idistributedcache/
Additional context
The error after app restart looks like this
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5
@sergey-tihon : @jennyf19 also authored an article on how to use a redis cache hosted locally in Docker. This is a very simple solution too: https://github.com/AzureAD/microsoft-identity-web/wiki/Set-up-a-Redis-cache-in-Docker
answered.