egg-http-auth
v1.0.1
Published
egg plugin for HTTP basic and digest access authentication
Downloads
145
Readme
egg-http-auth
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',
// which routes you want to using this middleware
match: '',
// which routes you want to ignore this middleware
// ignore: ''
// match: (ctx) {
// }
};
Configuration
// {app_root}/config/config.default.js
exports.httpAuth = {
username: 'username',
password: 'password',
};
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.