New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@axolo/egg-oauth

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@axolo/egg-oauth

OAuth2 server plugin for Egg.js.

latest
Source
npmnpm
Version
0.1.6
Version published
Maintainers
1
Created
Source

egg-oauth

node-oauth2-server plugin for Egg.js.

Install

npm i @axolo/egg-oauth --save

Usage

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

Configuration

// {app_root}/config/config.default.js
exports.oauth = {
  client: {
    OAuth2Sever: require('oauth2-server'), // user defined oauth2-server version
    model: require('./oauth-model'), // model require
    accessTokenLifetime: 7200, // default 3600
    requireClientAuthentication: {
      password: false,
    },
  },
};

MUST build OAuth2 Model Specification at model in config by yourselves.

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

props

propsdescription
OAuth2Serverclass of OAuth2Server
Responseclass of OAuth2Server.Response
Requestclass of OAuth2Server.Request

model

A example of model.

// app/config/oauth-model.js
module.exports = (options, app) => ({
  getClient: (clientId, clientSecret) => {
    return { clientId, clientSecret };
  },
  // ...
});

TODO

  • get request in model

Questions & Suggestions

Please open an issue here.

License

MIT

Keywords

egg

FAQs

Package last updated on 04 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts