@lxghtless/openid-client-server-redis-session
A Redis session store for @optum/openid-client-server .
Install
npm i @lxghtless/openid-client-server-redis-session
yarn add @lxghtless/openid-client-server-redis-session
Basic Usage
import RedisSessionStore from '@lxghtless/openid-client-server-redis-session'
// Any option from https://www.npmjs.com/package/redis#rediscreateclient
const redisClientOptions = {
host: '127.0.0.1:6379'
}
// A string used to prefix sessionId's for storing in redis
const sessionKeyPrefix = 'web-app-sessions'
const sessionStore = new RedisSessionStore(redisClientOptions, sessionKeyPrefix)
With Auth
import RedisSessionStore from '@lxghtless/openid-client-server-redis-session'
// Any option from https://www.npmjs.com/package/redis#rediscreateclient
const redisClientOptions = {
host: '127.0.0.1:6379'
}
// A string used to prefix sessionId's for storing in redis
const sessionKeyPrefix = 'web-app-sessions'
const sessionStore = new RedisSessionStore(redisClientOptions, sessionKeyPrefix)
const redisPassword = 'PasswordToAccessRedis'
await sessionStore.client.auth(redisPassword)