<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 29, 2016 at 11:04 AM, Scott Rossillo <span dir="ltr"><<a href="mailto:srossillo@smartling.com" target="_blank">srossillo@smartling.com</a>></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('./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 "app.use(‘foo’, keycloak.protect(), foo)” causes infinite redirects</div></div></blockquote><div><a href="https://issues.jboss.org/browse/KEYCLOAK-3199">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">https://github.com/keycloak/keycloak-nodejs-connect/pull/43</a><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"><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 class=""><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>_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org">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>