{"id":16751,"library":"vantage-auth-basic","title":"Basic Authentication for Vantage.js","description":"vantage-auth-basic is an authentication extension designed for the vantage.js interactive CLI framework. It provides basic authentication capabilities, prompting users for usernames and passwords configured on the Vantage server. Key features include configurable retry limits for incorrect password attempts, a delay between retries, and an account lockout mechanism with a specified unlock timeout. As of version 1.0.0, this extension is tightly integrated with vantage.js and is often used by simply specifying the string \"basic\" in the vantage.auth() method, negating the need for a separate `require()` call when used within a Vantage application. Given the vantage.js framework's last significant activity being several years ago, this package is effectively abandoned and not recommended for new projects.","status":"abandoned","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/vantagejs/vantage-auth-basic","tags":["javascript","api","cli","repl","vantage","vantagejs","auth","authentication","extension"],"install":[{"cmd":"npm install vantage-auth-basic","lang":"bash","label":"npm"},{"cmd":"yarn add vantage-auth-basic","lang":"bash","label":"yarn"},{"cmd":"pnpm add vantage-auth-basic","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is an authentication extension specifically designed for and integrated with the vantage.js interactive CLI framework.","package":"vantage","optional":false}],"imports":[{"note":"This package is primarily for CommonJS environments due to its age and the `vantage.js` ecosystem. ESM imports are not supported.","wrong":"import basicAuth from 'vantage-auth-basic';","symbol":"basicAuth","correct":"var basicAuth = require(\"vantage-auth-basic\");"},{"note":"This is the recommended and most common way to integrate this authentication, as it's often built into Vantage.js itself and doesn't require an explicit `require()` call.","symbol":"\"basic\" string identifier","correct":"vantage.auth(\"basic\", options);"}],"quickstart":{"code":"var users = [\n\t{ user: \"admin\", pass: \"4k#842jx!%s\" },\n\t{ user: \"user\", pass: \"Unicorn11\" }\n];\n\nvar vantage = require(\"vantage\")();\n\nvantage.auth(\"basic\", {\n\t\"users\": users,\n  \"retry\": 3,\n  \"retryTime\": 500,\n  \"deny\": 1,\n  \"unlockTime\": 3000\n});\n\nvantage\n  .command(\"whoami\", \"Outputs logged in user.\")\n  .action(function(args, cb){\n  \tconsole.log(\"You are \" + this.user);\n  \tcb();\n  });\n\n// To make the Vantage instance active, you would typically call .listen() or similar.\n// For example, vantage.listen(4000) or run it from the command line if installed globally.\n// This snippet primarily demonstrates the authentication setup.","lang":"javascript","description":"This quickstart demonstrates how to configure basic authentication with `vantage-auth-basic` for a Vantage.js instance, defining users, retry policies, and an example command that accesses the authenticated user's information."},"warnings":[{"fix":"Migrate to a currently maintained CLI framework and authentication solution, such as Commander.js or Oclif with appropriate authentication middleware.","message":"This package and its parent framework, Vantage.js, are no longer actively maintained. Using them in modern Node.js environments (v12+) may lead to compatibility issues, unpatched security vulnerabilities, or unexpected behavior. It is strongly advised not to use this package for new projects or in production environments.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"If absolutely necessary to use, ensure your project uses CommonJS modules. For new development, consider alternative, actively maintained CLI frameworks.","message":"This package is part of the older Vantage.js ecosystem, primarily designed for CommonJS environments and Node.js versions up to 0.x / 1.x. Modern Node.js projects (ESM-first, recent Node versions) will encounter compatibility issues with `require()` and may prefer more modern authentication solutions.","severity":"gotcha","affected_versions":"1.0.0"},{"fix":"Use `vantage.auth(\"basic\", options);` instead of explicitly requiring the module if integrating directly into a Vantage instance.","message":"Direct `require(\"vantage-auth-basic\")` is often unnecessary. Vantage.js itself integrates this authentication method, allowing users to simply pass the string \"basic\" to `vantage.auth()`. Relying on the string is generally preferred for consistency with the framework.","severity":"gotcha","affected_versions":"1.0.0"},{"fix":"For production, pre-hash passwords before storing them in the `users` array and implement custom verification logic within Vantage, or use a separate authentication system.","message":"User passwords are configured directly in memory via the `users` option. For production environments, consider implementing a more secure password storage and verification mechanism (e.g., hashing passwords and verifying against a database) rather than hardcoded credentials. This package does not provide robust password management or hashing itself.","severity":"gotcha","affected_versions":"1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Check the username and password for correctness. If locked out, wait for the 'unlockTime' duration to expire, or restart the Vantage session if the lockout is session-bound. Review the 'retry' and 'unlockTime' options in your configuration for appropriate values.","cause":"The user failed to authenticate within the configured 'retry' limit, leading to a session kick-out.","error":"Access denied: too many login attempts."}],"ecosystem":"npm"}