[keycloak-user] Getting logged in user through Node API's
Rushil Agarwal
rushil.vaish at gmail.com
Tue Dec 22 04:58:48 EST 2015
Hi Team,
I ave implemented Keycloak using npm package "connect-keycloak"
I am not able to find any example or help to fetch in the currently logged
in userid through Node API's.
Any help would be appreciated.
My code snippet:
*App.js*
var memoryStore = new session.MemoryStore();
var routes = require('./routes/index');
var users = require('./routes/users');
app.use( session({
secret: 'aaslkdhlkhsd',
resave: false,
saveUninitialized: true,
store: memoryStore,
} ))
var keycloak = new Keycloak({
store: memoryStore
});
app.use( keycloak.middleware( {
logout: '/logout',
admin: '/',
} ));
*Index.js*
router.get('/',keycloak.protect(),function(req, res, next) {
res.sendfile('pages/index.html',{root:'./public'});
});
--
--
*With best regards :-*
Rushil Agarwal
Mobile: +91 78298 86000
Please don't print this e-mail unless you really need to. SAVE PAPER TO
SAVE TREES
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20151222/39a56c87/attachment.html
More information about the keycloak-user
mailing list