Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oauth2-server-mongoose

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oauth2-server-mongoose

MongoDB/Mongoose storage backend for oauth2-server

  • 1.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
251
increased by4.58%
Maintainers
1
Weekly downloads
 
Created
Source

oauth2-server-mongoose

Build Status Dependency Status Download Status Sponsor on GitHub

MongoDB/Mongoose storage backend for oauth2-server

Features

  • Stores the following in MongoDB:
    • Clients
    • Users
  • Bundled Mongoose models encrypt client secrets and user passwords using bcrypt

Requirements

Installation

$ npm install --save @compwright/oauth2-server oauth2-server-mongoose mongoose mongoose-bcrypt

Usage

const OAuth2Server = require('@compwright/oauth2-server');
const mongooseStore = require('oauth2-server-mongoose');

const oauth = new OAuth2Server({
    model: {
        ...mongooseStore({
            // Optional - you can specify your own models for clients and users:
            // ClientModel: mongoose.model('OAuthClient'),
            // UserModel: mongoose.model('OAuthUser')
        })
    }
});

See client.model.js and user.model.js for the default model configuration.

Note: if you do supply your own models, be sure to maintain the same plugins, static methods and query helpers.

Bundled Scripts

oauth2-create-client [dburl]

Interactive script to add a client to the oauthclients database collection.

Generates and encrypts the client secret automatically.

oauth2-create-user [dburl]

Interactive script to add a user to the oauthusers database collection.

Encrypts the user password automatically.

License

MIT license

Keywords

FAQs

Package last updated on 12 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc