I'm trying to implement keycloak on my node.js apps.
I'm using keycloak-nodejs-connect on my node.js apps.
If there is no operation on the website for longer than session idle time, I would like to automatically go to the login page or notify the user that are logged out (When session is expired, pressing F5 will automatically bring up the login page).
Keycloak version : 12.0.0 keycloak-nodejs-connect version : 12.0.4
I just using I wrote the code by referring to the source code below.
https://github.com/keycloak/keycloak-nodejs-connect/blob/master/example/index.js
How do I redirect the client page to login page or logout page?
Thanks for comments.
Here is the code.
app.js var memoryStore = new session.MemoryStore();
app.use(session({ secret: 'mySecret', resave: false, saveUninitialized: true, store: memoryStore }));
var keycloak = new Keycloak({ store: memoryStore });
app.use(keycloak.middleware({ logout: '/logout', admin:'/' }));
index.js(router) var Keycloak = require('keycloak-connect');
var memoryStore = new session.MemoryStore(); var keycloak = new Keycloak({ store: memoryStore });