auth-center
auth center with TOTP
Last updated a month ago by d-band .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install auth-center 
SYNC missed versions from official npm registry.

Auth Center (OAuth2.0 + TOTP)

NPM version NPM downloads Build Status Coverage Status Dependency Status

安装

// 全局安装
npm i auth-center -g
// 非全局安装
npm i auth-center -S

功能列表

  • 配置方便、简单,UI简洁
  • 多数据库支持:MySQL、Postgres、sqlite、mariadb
  • session支持redis等
  • OAuth2.0 授权码模式
  • 密码验证增强(TOTP)
  • 自带后台管理

使用说明

完整配置文件参考:config.js

1. 采用命令行执行

$ auth-center -h

  Usage: auth-center [options] [command]


  Commands:

    init              init config
    start [options]   start server

  Options:

    -h, --help     output usage information
    -v, --version  output the version number

$ auth-center init

$ auth-center start -h

  Usage: auth-center start [options]

  start server

  Options:

    -h, --help         output usage information
    -p, --port <port>  server port
    --config <path>    custom config path
    --sync             sync database to generate tables
    --data <path>      init data with json file
    

2. 采用引入方式执行

const AuthServer = require('auth-center');

const server = AuthServer({
  domain: 'http://passport.example.com',
  orm: {
    database: 'db_auth',
    username: 'root',
    password: 'xxxx',
    dialect: 'mysql',
    host: '127.0.0.1',
    port: 3306,
    pool: {
      maxConnections: 10,
      minConnections: 0,
      maxIdleTime: 30000
    }
  },
  mail: {
    from: '系统管理员 <admin@example.com>',
    host: 'smtp.example.com',
    port: 465,
    secure: true,
    auth: {
      user: 'admin@example.com',
      pass: 'admin'
    }
  }
});

server.listen(3000);

server.orm.database().sync({
  force: true
}).then(() => { console.log('Sync done.'); });

开发

git clone https://github.com/d-band/auth-center.git
cd auth-center

npm install

npm run dev
npm start

参考链接

Current Tags

  • 2.1.1                                ...           latest (a month ago)

52 Versions

  • 2.1.1                                ...           a month ago
  • 2.1.0                                ...           a month ago
  • 2.0.2                                ...           4 months ago
  • 2.0.1                                ...           4 months ago
  • 2.0.0                                ...           4 months ago
  • 1.13.4                                ...           9 months ago
  • 1.13.3                                ...           a year ago
  • 1.13.2                                ...           a year ago
  • 1.13.1                                ...           a year ago
  • 1.13.0                                ...           a year ago
  • 1.12.6                                ...           a year ago
  • 1.12.5                                ...           2 years ago
  • 1.12.4                                ...           2 years ago
  • 1.12.3                                ...           2 years ago
  • 1.12.2                                ...           2 years ago
  • 1.12.1                                ...           2 years ago
  • 1.12.0                                ...           2 years ago
  • 1.11.0                                ...           2 years ago
  • 1.10.1                                ...           2 years ago
  • 1.10.0                                ...           2 years ago
  • 1.9.1                                ...           3 years ago
  • 1.9.0                                ...           3 years ago
  • 1.8.1                                ...           3 years ago
  • 1.8.0                                ...           3 years ago
  • 1.7.0                                ...           3 years ago
  • 1.6.2                                ...           3 years ago
  • 1.6.1                                ...           3 years ago
  • 1.6.0                                ...           3 years ago
  • 1.5.1                                ...           3 years ago
  • 1.5.0                                ...           3 years ago
  • 1.4.3                                ...           3 years ago
  • 1.4.2                                ...           3 years ago
  • 1.4.1                                ...           3 years ago
  • 1.4.0                                ...           3 years ago
  • 1.3.0                                ...           3 years ago
  • 1.2.3                                ...           4 years ago
  • 1.2.2                                ...           4 years ago
  • 1.2.1                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.0.11                                ...           4 years ago
  • 0.0.10                                ...           4 years ago
  • 0.0.9                                ...           4 years ago
  • 0.0.8                                ...           4 years ago
  • 0.0.7                                ...           4 years ago
  • 0.0.6                                ...           4 years ago
  • 0.0.5                                ...           4 years ago
  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 102
Dependencies (19)
Dev Dependencies (30)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |