Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 1.1 KB

README.md

File metadata and controls

25 lines (18 loc) · 1.1 KB

keycloak-sample

Use of keycloak REST APIs to automate creation of clients, users, and so on, created initially to figure out how to automate test creation for express.js/keycloak-connect based services.

First off: use keycloak-connect, NOT connect-keycloak

This repo came about as a result of trying to figure out how to use keycloak for my little chatbak project. What I wanted to do was to be able to automate the creation of users, clients, and so on, and I found that there weren't really any good examples of doing so.

As a result I wrote a little utility module called jsUtils.js and used it to create a test setup.

In order to run this sample, after cloning the repo, say

docker run -e KEYCLOAK_USER=foo -e KEYCLOAK_PASSWORD=bar -p 8080:8080 jboss/keycloak
npm install
npm test

You can require this as a module as well (not published to npm, just put the git repo as a dependency in package.json):

cons kc = require('kc-utils')('http://localhost:8080/auth');