New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

auth-center

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auth-center

auth center with TOTP

  • 2.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
115
decreased by-90.43%
Maintainers
1
Weekly downloads
 
Created
Source

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

参考链接

Keywords

FAQs

Package last updated on 09 Dec 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc