{"id":18130,"library":"auth-center","title":"Auth Center","description":"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.","status":"active","version":"2.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/d-band/auth-center","tags":["javascript","auth","center","TOTP","HOTP"],"install":[{"cmd":"npm install auth-center","lang":"bash","label":"npm"},{"cmd":"yarn add auth-center","lang":"bash","label":"yarn"},{"cmd":"pnpm add auth-center","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Web framework for handling HTTP requests and OAuth2 endpoints","package":"express","optional":false},{"reason":"ORM for database support (MySQL, Postgres, SQLite, MariaDB)","package":"sequelize","optional":false},{"reason":"TOTP/HOTP implementation for one-time password verification","package":"notp","optional":false}],"imports":[{"note":"Package uses CommonJS, not ES modules. Default import via require.","wrong":"import AuthServer from 'auth-center';","symbol":"default","correct":"const AuthServer = require('auth-center');"},{"note":"AuthServer is a factory function, not a class. Do not use 'new'.","wrong":"new AuthServer({...})","symbol":"AuthServer","correct":"const server = AuthServer({...});"},{"note":"Use full option names (--port, --sync) for clarity.","wrong":"$ auth-center start -p 3000 -s","symbol":"CLI usage","correct":"$ auth-center start --port 3000 --sync"}],"quickstart":{"code":"const AuthServer = require('auth-center');\n\nconst server = AuthServer({\n  domain: 'http://localhost:3000',\n  orm: {\n    database: 'db_auth',\n    username: 'root',\n    password: process.env.DB_PASSWORD ?? '',\n    dialect: 'sqlite',\n    storage: './auth.db'\n  },\n  session: {\n    secret: 'my-secret-key'\n  },\n  mail: {\n    from: 'admin@example.com',\n    host: 'smtp.example.com',\n    port: 465,\n    secure: true,\n    auth: {\n      user: 'user',\n      pass: 'pass'\n    }\n  }\n});\n\nserver.listen(3000, () => {\n  console.log('Auth Center running on http://localhost:3000');\n  server.orm.database().sync({ force: true }).then(() => console.log('Sync done.'));\n});","lang":"javascript","description":"Initializes an Auth Center server with SQLite, syncs database schema, and listens on port 3000."},"warnings":[{"fix":"Upgrade Node.js to version 8 or higher.","message":"Removed support for Node.js < 8. Engines field requires node >= 8.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use alter: true or migrate manually instead of force.","message":"Using force: true on sync will drop existing tables. Use with caution in production.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use authorization code flow or extend the library.","message":"OAuth2.0 only supports authorization code grant type; implicit and client credentials are not implemented.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always set session.secret in config.","message":"Session secret must be provided via config, otherwise default is insecure.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use 'postgres' (lowercase) in orm.dialect.","message":"Database dialect 'postgres' renamed to 'postgres' (case-sensitive).","severity":"breaking","affected_versions":">=2.2.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install auth-center --save' in project root.","cause":"Package not installed or incorrect install path.","error":"Error: Cannot find module 'auth-center'"},{"fix":"Create the database manually or set orm.dialect to 'sqlite' for file-based storage.","cause":"Database does not exist or config uses wrong dialect.","error":"SequelizeConnectionError: Unknown database 'db_auth'"},{"fix":"Use 'const server = AuthServer(config);' without 'new'.","cause":"Using 'new AuthServer()' instead of calling AuthServer() as a function.","error":"TypeError: AuthServer is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}