1.4.0 • Published 1 year ago

oauth2-server-jwt v1.4.0

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

oauth2-server-jwt

Build Status Download Status Sponsor on GitHub

Storageless JWT token generator backend for oauth2-server

Features

  • Respects oauth2-server token lifetime configuration for each type of token
  • Generates JWT access tokens, refresh tokens, and authorization codes

Limitations

For proper verification of aud, scope, and redirectUri, you will need to implement model.getClient() separately.

If you need to support the password grant type, you will also need to implement model.getUser() separately.

Suggested implementation: oauth2-server-mongoose

Requirements

Installation

$ npm install --save @compwright/oauth2-server oauth2-server-jwt

Usage

const OAuth2Server = require('@compwright/oauth2-server');
const jwtMixin = require('oauth2-server-jwt');
const mongooseMixin = require('oauth2-server-mongoose');

const oauth = new OAuth2Server({
    model: {
        ...jwtMixin({
            accessTokenSecret,                  // String (required)
            refreshTokenSecret,                 // String (required)
            authorizationCodeSecret,            // String (required)
            issuer,                             // String (required)
            userId: 'id'                        // String
            algorithms: ['HS256']               // Array[String]
        }),
        ...mongooseMixin()
    }
});

License

MIT license

1.4.0

1 year ago

1.3.0

1 year ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

5 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 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