egg-oauth-jwt

1.7.7 • Public • Published

egg-oauth-jwt

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

Install

$ npm i egg-oauth-jwt --save

Usage

// {app_root}/config/plugin.js
exports.oauthjwt = {
  enable: true,
  package: 'egg-oauth-jwt',
};

Configuration

// {app_root}/config/config.default.js
exports.oauthjwt = {
    extend: 'oauth',
    algorithm: 'RS256',
    primaryKey: path.join(__dirname, "private.pem"),
    publicKey: path.join(__dirname, 'public.pem'),
    clientSide: false,
    accessTokenLifeTime: 7200,
    refreshTokenLifeTime: 864000,
    authorizationCodeLifeTime: 120,
    tokenType: 'Bearer'
};

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

Package Sidebar

Install

npm i egg-oauth-jwt

Weekly Downloads

1

Version

1.7.7

License

MIT

Unpacked Size

36.5 kB

Total Files

17

Last publish

Collaborators

  • tristanwong