[keycloak-user] Node.js Adapter usage

Sebastien Blanc sblanc at redhat.com
Fri Feb 17 04:30:06 EST 2017


On Thu, Feb 9, 2017 at 6:02 PM, Sandro Santilli <strk at kbt.io> wrote:

> Hi all, I've just subscribed to this list as I'm working on adding keycloak
> support in a node.js project.
>
> Unfortunately, following the instructions on [1] I was unable to pass
> the `var keycloack = new Keycloak()` step, in that `Keycloak` class
> is not defined.
>
> [1] https://keycloak.gitbooks.io/securing-client-applications-
> guide/content/topics/oidc/nodejs-adapter.html
>
> I guess I have to require the module, but when I try
> `var Keycloak = require('keycloak-connect')` I get a failure message:
>
>   /usr/src/akvo/akvo-maps/akvo-maps/images/tiler/server/node_
> modules/keycloak-connect/index.js:254
>       .then(grant => { return this.grantManager.ensureFreshness(grant); })
>                    ^
>   SyntaxError: Unexpected token >
>       at Module._compile (module.js:439:25)
>       at Object.Module._extensions..js (module.js:474:10)
>       at Module.load (module.js:356:32)
>       at Function.Module._load (module.js:312:12)
>       at Module.require (module.js:364:17)
>       at require (module.js:380:17)
>       at Object.<anonymous> (/usr/src/akvo/akvo-maps/akvo-
> maps/images/tiler/server/http/server.js:10:16)
>       at Module._compile (module.js:456:26)
>       at Object.Module._extensions..js (module.js:474:10)
>       at Module.load (module.js:356:32)
>
> This is with node-0.10 though, while node-4.2.6 does not complain there
> (but does in another place).
>
> So, a few questions:
>
>   1. Where to report the lack of `require('keycloak-connect')`
>      instruction in the documentation ?
>
You can open a ticket here : http://jira.jboss.com/jira/browse/KEYCLOAK

>
>   2. What's the least supported node version ?
>
Node 4.0.0 is the minimum required

>
>   3. Are there working examples I could look at ?
>
We have a quickstart here :
https://github.com/keycloak/keycloak-quickstarts/tree/master/service-nodejs

>
> Thanks in advance
>
> --strk;
>
>  ()  ASCII ribbon campaign  --  Keep it simple !
>  /\  https://strk.kbt.io/rants/ascii_mails.txt
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>


More information about the keycloak-user mailing list