[keycloak-user] Node.js Adapter usage

Sandro Santilli strk at kbt.io
Thu Feb 9 12:02:36 EST 2017


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 ?

  2. What's the least supported node version ?

  3. Are there working examples I could look at ?

Thanks in advance

--strk; 

 ()  ASCII ribbon campaign  --  Keep it simple !
 /\  https://strk.kbt.io/rants/ascii_mails.txt  


More information about the keycloak-user mailing list