node-oauth / node-oauth2-server

πŸš€ The successor to oauthjs/oauth2-server. πŸ”’ Complete, compliant, maintained and well tested OAuth2 Server for node.js. Includes native async await and PKCE.
https://www.npmjs.com/package/@node-oauth/oauth2-server
MIT License
321 stars 46 forks source link
async authentication authorization-code-flow authorization-code-grant await client-credentials-grant hacktoberfest javascript node nodejs npm-package oauth oauth2 password-grant pkce token-grant

@node-oauth/oauth2-server

Complete, compliant and well tested module for implementing an OAuth2 server in Node.js.

Tests CodeQL Semantic Analysis Tests for Release Documentation Status Project Status: Active – The project has reached a stable, usable state and is being actively developed. npm Version npm Downloads/Week GitHub License

NOTE: This project has been forked from oauthjs/node-oauth2-server and is a continuation due to the project appearing to be abandoned. Please see our issue board to talk about next steps and the future of this project.

Installation

npm install @node-oauth/oauth2-server

The @node-oauth/oauth2-server module is framework-agnostic but there are several officially supported wrappers available for popular HTTP server frameworks such as Express and Koa (not maintained by us). If you're using one of those frameworks it is strongly recommended to use the respective wrapper module instead of rolling your own.

Features

Documentation

Documentation is hosted on Read the Docs. We have multiple versions of the docs available:

Please leave an issue if something is confusing or missing in the docs.

Examples

Most users should refer to our Express (active) or Koa (not maintained by us) examples.

More examples can be found here: https://github.com/14gasher/oauth-example

Version 5 notes

Beginning with version 5.x we removed dual support for callbacks and promises. With this version there is only support for Promises / async/await.

With this version we also bumped the engine to Node 16 as 14 is now deprecated.

Migrating from OAuthJs and 3.x

Version 4.x should not be hard-breaking, however, there were many improvements and fixes that may be incompatible with specific behaviour in <= 3.x

For more info, please read the changelog or open an issue, if you think something is unexpectedly not working.

Supported NodeJs versions

This project supports the node versions along the NodeJS LTS releases, focusing on

Contributing to this project

Please read our contribution guide before taking actions. In any case, please open an issue before opening a pull request to find out whether your intended contribution will actually have a chance to be merged.