1.3.3 • Published 3 years ago

oauth2-server-mongoose v1.3.3

Weekly downloads
158
License
MIT
Repository
github
Last release
3 years ago

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

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago