I would like to build a progressive webapp (PWA) with angular that has to work in offline mode also. This means that when there is no network and the user refreshed the page what he should see then comes from a cache (initiated by service workers).
I would like to use keycloak for this app for user authentication.
The problem is that with keycloak-angular after page refresh in simulated offline mode, keycloak performs a redirect that fails. The same happens when i use the keycloak-js adpater directly with scope ‘offline_access’. So my question is is there a solution to use keycloak in this scenario?
Not sure how this works with keycloak-angular, but obviously you need to tell it to not try to do that when in offline mode. From superficial reading, I don’t see how that is possible. Maybe you can arrange it such that you detect if the app is started in offline mode and configure the app without keycloak-angular in that case, and then reload the application when you want to go online again.
OpenIDC and keycloak also support certain offline functionality. Not sure if that is of interest to your usecase.