Need private packages and team management tools?Check out npm Teams »

egg-keycloak

1.0.2 • Public • Published

egg-keycloak

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-keycloak --save

Usage

 
// {app_root}/config/plugin.js
exports.keycloak = {
  enable: true,
  package: 'egg-keycloak'
};
 
// router.js
router.get('/login', app.keycloak.protect(), controller.page.login)
router.get('/*', app.keycloak.checkSso(), controller.page.index)

Configuration

// {app_root}/config/config.default.js
exports.keycloak = {
 middleware: {
    logout: '/logout',
    admin: '/',
  },
  base: {
    store: true,
    cookies: false,
    idpHint: null,
    scope: null
  },
  kcConfig: { //keycloak.json
    clientId: '',
    serverUrl: '',
    realm: '',
    bearerOnly: false
  }
};

Support all configurations in keycloak-koa-connect. see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

Install

npm i egg-keycloak

DownloadsWeekly Downloads

15

Version

1.0.2

License

MIT

Unpacked Size

8.97 kB

Total Files

13

Last publish

Collaborators

  • avatar