<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 29, 2016 at 11:06 AM, Luke Holmquist <span dir="ltr">&lt;<a href="mailto:lholmqui@redhat.com" target="_blank">lholmqui@redhat.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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Wed, Jun 29, 2016 at 11:04 AM, Scott Rossillo <span dir="ltr">&lt;<a href="mailto:srossillo@smartling.com" target="_blank">srossillo@smartling.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>Hey,</div><div><br></div><div>I’m trying to register the NodeJS Keycloak Connect (0.22) with Express routes, such as:</div><div><br></div><div>var foo = require(&#39;./routes/foo’);</div><div>app.use(‘/foo’, foo);</div><div><br></div><div>The problems are:</div><div><br></div><div>1. Adding the Keycloak protect middleware with &quot;app.use(‘foo’, keycloak.protect(), foo)” causes infinite redirects</div></div></blockquote></span><div><a href="https://issues.jboss.org/browse/KEYCLOAK-3199" target="_blank">https://issues.jboss.org/browse/KEYCLOAK-3199</a><br> <br></div><div>almost fixed:  <a href="https://github.com/keycloak/keycloak-nodejs-connect/pull/43" target="_blank">https://github.com/keycloak/keycloak-nodejs-connect/pull/43</a></div></div></div></div></blockquote><div><br></div><div>a 0.2.1 version was just released on npm that should fix that infinite redirect issue <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><div style="word-wrap:break-word"><div>2. It can’t be registered in the route javascript file because keycloak.protect() expects the already initialized keycloak function.</div><div><br></div><div>When dealing with large applications, it’s not feasible to register all routes in the main Express file.</div><div><br></div><div>Any pointers or am I missing something?</div><div><br></div><div>Thanks in advance,</div><div>Scott</div><span><font color="#888888"><div><br></div><br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Scott Rossillo</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Smartling | Senior Software Engineer</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:srossillo@smartling.com" target="_blank">srossillo@smartling.com</a></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
</div>
</div></div><br></font></span></div><br></span>_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br></blockquote></div><br></div></div>
</blockquote></div><br></div></div>