<div dir="ltr">Hi Team,<div><br></div><div>Kindly help in getting some help in fetching logged in user through Node API&#39;s.</div><div>I have attached code what I have written in previous mail.</div><div><br></div><div>Thanks in advance.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 22, 2015 at 3:58 AM, Rushil Agarwal <span dir="ltr">&lt;<a href="mailto:rushil.vaish@gmail.com" target="_blank">rushil.vaish@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Team,<div><br></div><div>I ave implemented Keycloak using npm package &quot;connect-keycloak&quot;</div><div><br></div><div>I am not able to find any example or help to fetch in the currently logged in userid through Node API&#39;s.</div><div>Any help would be appreciated.</div><div><br></div><div>My code snippet:</div><div><br></div><div><b>App.js</b></div><div><div><br></div><div>var memoryStore = new session.MemoryStore();</div><div>var routes = require(&#39;./routes/index&#39;);</div><div>var users = require(&#39;./routes/users&#39;);</div><div><br></div><div>app.use( session({</div><div>  secret: &#39;aaslkdhlkhsd&#39;,</div><div>  resave: false,</div><div>  saveUninitialized: true,</div><div>  store: memoryStore,</div><div>} ))</div><div><br></div><div>var keycloak = new Keycloak({</div><div>  store: memoryStore</div><div>});</div><div><br></div><div>app.use( keycloak.middleware( {</div><div>  logout: &#39;/logout&#39;,</div><div>  admin: &#39;/&#39;,</div><div>} ));</div><div><br></div><div><b>Index.js</b></div><div><div>router.get(&#39;/&#39;,keycloak.protect(),function(req, res, next) {</div><div>  </div><div>    res.sendfile(&#39;pages/index.html&#39;,{root:&#39;./public&#39;});</div><div>});</div></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><span style="color:rgb(0,0,0);font-family:arial;font-size:small">-- </span><br style="color:rgb(0,0,0);font-family:arial;font-size:small"><b style="color:rgb(0,0,0);font-family:arial;font-size:small">With best regards :-</b><br style="color:rgb(0,0,0);font-family:arial;font-size:small"><font style="font-family:arial;font-size:small" color="#990000"><br></font><div><font style="font-family:arial;font-size:small" color="#990000">Rushil Agarwal</font><div><font color="#990000" face="arial" size="2"><br></font><div><font color="#996633" style="font-family:arial;font-size:small">Mobile: <a href="tel:%2B91%2078298%2086000" value="+917829886000" target="_blank">+91 78298 86000</a></font><div style="color:rgb(0,0,0);font-family:arial;font-size:small"><br></div><div style="color:rgb(0,0,0);font-family:arial;font-size:small"><font color="#006600">Please don&#39;t print this e-mail unless you really need to. SAVE PAPER TO SAVE TREES</font></div></div></div></div></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><span style="color:rgb(0,0,0);font-family:arial;font-size:small">-- </span><br style="color:rgb(0,0,0);font-family:arial;font-size:small"><b style="color:rgb(0,0,0);font-family:arial;font-size:small">With best regards :-</b><br style="color:rgb(0,0,0);font-family:arial;font-size:small"><font style="font-family:arial;font-size:small" color="#990000"><br></font><div><font style="font-family:arial;font-size:small" color="#990000">Rushil Agarwal</font><div><font color="#990000" face="arial" size="2"><br></font><div><font color="#996633" style="font-family:arial;font-size:small">Mobile: +91 78298 86000</font><div style="color:rgb(0,0,0);font-family:arial;font-size:small"><br></div><div style="color:rgb(0,0,0);font-family:arial;font-size:small"><font color="#006600">Please don&#39;t print this e-mail unless you really need to. SAVE PAPER TO SAVE TREES</font></div></div></div></div></div></div>
</div>