@lxghtless/openid-client-server-mongo-session
A Mongo DB session store for @optum/openid-client-server .
Install
npm i @lxghtless/openid-client-server-mongo-session
yarn add @lxghtless/openid-client-server-mongo-session
Basic Usage
import {
MongoSessionStore,
MongoSessionStoreOptions
} from '@lxghtless/openid-client-server-mongo-session'
const mongoUrl = 'mongodb://mongodb0.example.com:27017'
const storeOptions: MongoSessionStoreOptions = {
dbName: 'openid-session-db',
collectionName: 'openIdSessions'
}
const sessionStore = await MongoSessionStore.createSessionStore(
mongoUrl,
storeOptions
)
Pre-Created MongoClient
import {MongoClient} from 'mongodb'
import {
MongoSessionStore,
MongoSessionStoreOptions
} from '@lxghtless/openid-client-server-mongo-session'
const mongoUrl = 'mongodb://mongodb0.example.com:27017'
const storeOptions: MongoSessionStoreOptions = {
dbName: 'openid-session-db',
collectionName: 'openIdSessions'
}
const mongoClient = new MongoClient(mongoUrl)
const sessionStore = new MongoSessionStore(mongoClient, storeOptions)