Skip to content

egg plugin for HTTP basic and digest access authentication

License

Notifications You must be signed in to change notification settings

Justin-lu/egg-http-auth

Repository files navigation

egg-http-auth

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

egg plugin for HTTP basic and digest access authentication.

Install

$ npm i egg-http-auth --save

Usage

// {app_root}/config/plugin.js
exports.httpAuth = {
  enable: true,
  package: 'egg-http-auth',
};

Configuration

// {app_root}/config/config.default.js
exports.httpAuth = {
  username: 'username',
  password: 'password',
  // match: '',
  // which routes you want to ignore this middleware
  // ignore: ''
  // match: (ctx) {
  // }
};

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

Example

// for old version eggjs which does support match options
// {app_root}/config/config.default.js
exports.httpAuth = {
  username: 'username',
  password: 'password',
  match: /^\/api\/v1\/backdoor/
};

Questions & Suggestions

Please open an issue here.

License

MIT

About

egg plugin for HTTP basic and digest access authentication

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published