How can I run a React application with the oidc-client in a SSR environment?
I am working on a React implementation which uses the oidc-client (v 1.7.1). In a non-SSR environment the solution is fine. But one of our requirements is that the solution should run in a SSR environment. To solve this problem I need to change the storage in the setup of the oidc-client.
I have tried the solution to use cookie storage instead of the session or localstorage (check https://github.com/IdentityModel/oidc-client-js/issues/269) but this type of storage does not work (the store is undefined).
const settings = {
userStore: new WebStorageStateStore({ store: new CookieStorage() }),
stateStore: new WebStorageStateStore({ store: new CookieStorage() }),
};
this.userManager = new UserManager(settings);
What is the best solution to use the oidc-client in an SSR environment? Is the oidc-client usable in combination with SSR?