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

1.0.0 • Public • Published

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

Package Sidebar

Install

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

Weekly Downloads

7

Version

1.0.0

License

Apache-2.0

Unpacked Size

26.9 kB

Total Files

7

Last publish

Collaborators

  • lxghtless