Registry / auth-security / auth-center

auth-center

JSON →
library2.2.0jsnpmunverified

Auth Center is an OAuth2.0 authorization server with TOTP (Time-based One-Time Password) support for Node.js. Version 2.2.0 (stable) includes built-in admin UI, supports MySQL, PostgreSQL, SQLite, and MariaDB via Sequelize ORM, and provides both CLI and programmatic interfaces. It implements the OAuth2.0 authorization code grant flow and enhances password authentication with TOTP. Compared to alternatives like oauth2orize, it offers an all-in-one solution with session management (Redis support), email integration, and database schema synchronization.

npm install auth-center
INSTALL
IMPORT
SIG · AUTH-CENTER
A
auth-center
auth-securityjavascriptv2.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const AuthServer = require('auth-center');
import AuthServer from 'auth-center';
Package uses CommonJS, not ES modules. Default import via require.
AuthServer
const server = AuthServer({...});
new AuthServer({...})
AuthServer is a factory function, not a class. Do not use 'new'.
CLI usage
$ auth-center start --port 3000 --sync
$ auth-center start -p 3000 -s
Use full option names (--port, --sync) for clarity.

Initializes an Auth Center server with SQLite, syncs database schema, and listens on port 3000.

const AuthServer = require('auth-center'); const server = AuthServer({ domain: 'http://localhost:3000', orm: { database: 'db_auth', username: 'root', password: process.env.DB_PASSWORD ?? '', dialect: 'sqlite', storage: './auth.db' }, session: { secret: 'my-secret-key' }, mail: { from: 'admin@example.com', host: 'smtp.example.com', port: 465, secure: true, auth: { user: 'user', pass: 'pass' } } }); server.listen(3000, () => { console.log('Auth Center running on http://localhost:3000'); server.orm.database().sync({ force: true }).then(() => console.log('Sync done.')); });
auth-center --version
Debug
Known issues
breakingRemoved support for Node.js < 8. Engines field requires node >= 8.
fix
Upgrade Node.js to version 8 or higher.
affects: >=2.0.0
deprecatedUsing force: true on sync will drop existing tables. Use with caution in production.
fix
Use alter: true or migrate manually instead of force.
affects: >=1.0.0
gotchaOAuth2.0 only supports authorization code grant type; implicit and client credentials are not implemented.
fix
Use authorization code flow or extend the library.
affects: >=1.0.0
gotchaSession secret must be provided via config, otherwise default is insecure.
fix
Always set session.secret in config.
affects: >=1.0.0
breakingDatabase dialect 'postgres' renamed to 'postgres' (case-sensitive).
fix
Use 'postgres' (lowercase) in orm.dialect.
affects: >=2.2.0
Errors
Common errors & fixes
Error: Cannot find module 'auth-center'
Package not installed or incorrect install path.
fix
Run 'npm install auth-center --save' in project root.
SequelizeConnectionError: Unknown database 'db_auth'
Database does not exist or config uses wrong dialect.
fix
Create the database manually or set orm.dialect to 'sqlite' for file-based storage.
TypeError: AuthServer is not a constructor
Using 'new AuthServer()' instead of calling AuthServer() as a function.
fix
Use 'const server = AuthServer(config);' without 'new'.
Upgrade
Version history
2.2.0latest on npm
Audit
Dependencies
expressrequiredWeb framework for handling HTTP requests and OAuth2 endpoints
sequelizerequiredORM for database support (MySQL, Postgres, SQLite, MariaDB)
notprequiredTOTP/HOTP implementation for one-time password verification
Agent activity
41 hits · last 30 days
node
38
OpenAI (training)
1
Resources
auth-center — npm install auth-center · libregistry