Hi Team,

Kindly help in getting some help in fetching logged in user through Node API's.
I have attached code what I have written in previous mail.

Thanks in advance.

On Tue, Dec 22, 2015 at 3:58 AM, Rushil Agarwal <rushil.vaish@gmail.com> wrote:
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



--
-- 
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