Registry / security / volos-oauth-redis

volos-oauth-redis

JSON →
library0.13.0jsnpmunverified

Redis-backed OAuth 2.0 implementation for the Volos system. Current stable version is 0.13.0. This module provides an OAuth 2.0 implementation storing application credentials and access tokens in Redis. It exports the same programming interface as volos-oauth-common. Release cadence is low; last update is from 2016. Key differentiator: uses Redis as a data store for OAuth tokens and client credentials, suitable for high-performance Node.js applications needing distributed token storage. Alternatives like oauth2-server provide more comprehensive OAuth 2.0 frameworks.

npm install volos-oauth-redis
INSTALL
IMPORT
SIG · VOLOS-OAUTH-REDIS
V
volos-oauth-redis
securityjavascriptv0.13.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

create
import { create } from 'volos-oauth-redis';
const create = require('volos-oauth-redis').create;
ESM import since v0.12; CommonJS require also works.
default
import volosOauthRedis from 'volos-oauth-redis';
const volosOauthRedis = require('volos-oauth-redis');
Default export is the create function.
OAuth
import { OAuth } from 'volos-oauth-redis';
const OAuth = require('volos-oauth-redis').OAuth;
OAuth type not exported; use create to instantiate.

Shows how to create an OAuth instance with Redis options and issue a token.

import { create } from 'volos-oauth-redis'; const oauth = create({ host: process.env.REDIS_HOST ?? 'localhost', port: process.env.REDIS_PORT ?? 6379, db: 0 }); const client = { client_id: 'myApp', client_secret: 'mySecret', redirect_uris: ['http://localhost:3000/callback'], scope: 'read' }; await oauth.setClient(client); const token = await oauth.issueToken({ client_id: 'myApp', client_secret: 'mySecret', grant_type: 'authorization_code', code: 'someAuthCode', redirect_uri: 'http://localhost:3000/callback' }); console.log(token.access_token);
Debug
Known issues
gotchaRedis must be running and accessible at the provided host/port; otherwise create() will hang.
fix
Ensure Redis server is available before calling create().
affects: >=0.10.0
deprecatedThe client_id and client_secret are stored in plaintext in Redis.
fix
Consider using encryption or a more secure OAuth library.
affects: >=0.10.0
gotchaAll keys in Redis are prefixed with 'volos:' and stored in database 0 by default; changing db may cause conflicts.
fix
Specify a distinct db for each application if using multiple libraries.
affects: >=0.10.0
gotchaThe package uses a very old version of the 'redis' dependency (ca. 2012) which may have security issues.
fix
Update package or manually override redis dependency.
affects: >=0.10.0 <0.14.0
gotchaNo built-in token expiration or cleanup; tokens persist indefinitely unless manually deleted.
fix
Implement TTL using Redis expiration or schedule cleanup jobs.
affects: >=0.10.0
Errors
Common errors & fixes
Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED
Redis server not running on the specified host/port.
fix
Start Redis server or change host/port in options.
TypeError: oauth.setClient is not a function
Using default import incorrectly; create returns an OAuth object, but setClient may not exist if using an older version.
fix
Ensure you are using the correct version (0.12+) and importing create properly.
Error: Can't set headers after they are sent.
Middleware misconfiguration; the OAuth object's methods (e.g., verifyToken) may be called multiple times in the same request pipeline.
fix
Ensure callback is called only once per request.
Upgrade
Version history
0.13.0latest on npm
Audit
Dependencies
redisrequiredRedis client for connecting to Redis data store
Agent activity
28 hits · last 30 days
node
26
OpenAI (training)
1
Resources
volos-oauth-redis — npm install volos-oauth-redis · libregistry