@lxghtless/openid-client-server-redis-session
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@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)

Package Sidebar

Install

npm i @lxghtless/openid-client-server-redis-session

Weekly Downloads

5

Version

1.0.1

License

Apache-2.0

Unpacked Size

26.9 kB

Total Files

7

Last publish

Collaborators

  • lxghtless