A simple module to request an Access Token from a Keycloak Server.
Project Info | |
---|---|
License: | Apache-2.0 |
Build: | make |
Documentation: | http://bucharest-gold.github.io/keycloak-request-token/ |
Issue tracker: | https://github.com/bucharest-gold/keycloak-request-token/issues |
Engines: | Node.js 4.x, 6.x, 8.x |
npm install keycloak-request-token -S
'use strict';
const tokenRequester = require('keycloak-request-token');
const baseUrl = 'http://127.0.0.1:8080/auth';
const settings = {
username: 'admin',
password: 'admi',
grant_type: 'password',
client_id: 'admin-cli'
};
tokenRequester(baseUrl, settings)
.then((token) => {
console.log(token);
}).catch((err) => {
console.log('err', err);
});
Please read the contributing guide
If you've found a security vulnerability, please look at the instructions on how to properly report it