So you want your Angular app to work offline? Great, just build a Progressive Web App (PWA)! That’s easily said, but hardly the full story. What if you have an existing online app to which you want to add offline capabilities? Or perhaps you are designing a new app that will work mostly online, but needs one or two screens to work offline as well?
How do you add offline capabilities to a web application? If you search for an answer to these questions, the answer that will invariably pop up is to turn your application into a Progressive Web App (PWA). It is easy to find tutorials that cover the basics. But then the difficult questions arise: what architectural pattern do I use to fetch, store and cache my app’s data? How do I synchronize local changes to the data back to the server? How can I test all this?
When dealing with OpenID Connect (OIDC) and OAuth authentication in a modern .NET application, Identity Server is ofted used as the identity provider. In this post, I’ll work through a common, but quite specific scenario: configuring the lifetime of a client session. In this case, the user of an ASP.NET MVC Client must be logged out of the session after 15 minutes of inactivity. In such a setup, there are a lot of places where you can configure time-outs, lifetimes, expirations etc.