[keycloak-user] keycloak-nodejs-connect with Express routes
Scott Rossillo
srossillo at smartling.com
Wed Jun 29 11:57:22 EDT 2016
You’re the best. 0.2.1 fixed both issues!
Scott Rossillo
Smartling | Senior Software Engineer
srossillo at smartling.com
> On Jun 29, 2016, at 11:51 AM, Luke Holmquist <lholmqui at redhat.com> wrote:
>
>
>
> On Wed, Jun 29, 2016 at 11:06 AM, Luke Holmquist <lholmqui at redhat.com <mailto:lholmqui at redhat.com>> wrote:
>
>
> On Wed, Jun 29, 2016 at 11:04 AM, Scott Rossillo <srossillo at smartling.com <mailto:srossillo at smartling.com>> wrote:
> Hey,
>
> I’m trying to register the NodeJS Keycloak Connect (0.22) with Express routes, such as:
>
> var foo = require('./routes/foo’);
> app.use(‘/foo’, foo);
>
> The problems are:
>
> 1. Adding the Keycloak protect middleware with "app.use(‘foo’, keycloak.protect(), foo)” causes infinite redirects
> https://issues.jboss.org/browse/KEYCLOAK-3199 <https://issues.jboss.org/browse/KEYCLOAK-3199>
>
> almost fixed: https://github.com/keycloak/keycloak-nodejs-connect/pull/43 <https://github.com/keycloak/keycloak-nodejs-connect/pull/43>
>
> a 0.2.1 version was just released on npm that should fix that infinite redirect issue
>
>
> 2. It can’t be registered in the route javascript file because keycloak.protect() expects the already initialized keycloak function.
>
> When dealing with large applications, it’s not feasible to register all routes in the main Express file.
>
> Any pointers or am I missing something?
>
> Thanks in advance,
> Scott
>
>
> Scott Rossillo
> Smartling | Senior Software Engineer
> srossillo at smartling.com <mailto:srossillo at smartling.com>
>
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org <mailto:keycloak-user at lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/keycloak-user <https://lists.jboss.org/mailman/listinfo/keycloak-user>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160629/9dd9a068/attachment.html
More information about the keycloak-user
mailing list