https://github.com/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://github.com/node-oauth/node-oauth2-server
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
Last synced: 3 months ago
JSON representation
🚀 The successor to oauthjs/oauth2-server. 🔒 Complete, compliant, maintained and well tested OAuth2 Server for node.js. Includes native async await and PKCE.
- Host: GitHub
- URL: https://github.com/node-oauth/node-oauth2-server
- Owner: node-oauth
- License: mit
- Created: 2021-10-08T11:34:28.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-07-22T08:50:11.000Z (3 months ago)
- Last Synced: 2025-07-22T10:41:10.474Z (3 months ago)
- Topics: 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
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@node-oauth/oauth2-server
- Size: 1.91 MB
- Stars: 397
- Watchers: 9
- Forks: 53
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# @node-oauth/oauth2-server
Complete, compliant and well tested module for implementing an OAuth2 server in [Node.js](https://nodejs.org).
[](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests.yml)
[](https://github.com/node-oauth/node-oauth2-server/actions/workflows/codeql-analysis.yml)
[](https://github.com/node-oauth/node-oauth2-server/actions/workflows/tests-release.yml)
[](https://node-oauthoauth2-server.readthedocs.io/en/latest/?badge=latest)
[](https://www.repostatus.org/#active)
[](https://www.npmjs.com/package/@node-oauth/oauth2-server)
[](https://www.npmjs.com/package/@node-oauth/oauth2-server)
[](https://github.com/node-oauth/node-oauth2-server/blob/master/LICENSE)NOTE: This project has been forked from [oauthjs/node-oauth2-server](https://github.com/oauthjs/node-oauth2-server) and is a continuation due to the project appearing to be abandoned. Please see [our issue board](https://github.com/node-oauth/node-oauth2-server/issues) to talk about next steps and the future of this project.
## Installation
```bash
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](https://www.npmjs.com/package/@node-oauth/express-oauth-server) and [Koa (not maintained by us)](https://npmjs.org/package/koa-oauth-server).
If you're using one of those frameworks it is strongly recommended to use the respective wrapper module instead of rolling your own.## Features
- Supports `authorization_code`, `client_credentials`, `refresh_token` and `password` grant, as well as *extension grants*, with scopes.
- Can be used with *promises*, *ES6 generators* and *async*/*await* (using [Babel](https://babeljs.io)).
- Fully [RFC 6749](https://tools.ietf.org/html/rfc6749.html) and [RFC 6750](https://tools.ietf.org/html/rfc6750.html) compliant.
- Implicitly supports any form of storage, e.g. *PostgreSQL*, *MySQL*, *MongoDB*, *Redis*, etc.
- Support for PKCE
- Complete [test suite](https://github.com/node-oauth/node-oauth2-server/tree/master/test).## Documentation
Documentation is hosted on Read the Docs. We have multiple versions of the docs available:
- [stable](https://node-oauthoauth2-server.readthedocs.io/en/master/) (master branch)
- [development](https://node-oauthoauth2-server.readthedocs.io/en/development/) (development branch)Please leave an issue if something is confusing or missing in the docs.
## Examples
Most users should refer to our [Express (active)](https://github.com/node-oauth/express-oauth-server) or
[Koa (not maintained by us)](https://github.com/oauthjs/koa-oauth-server/tree/master/examples) 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.xFor more info, please read the [changelog](./CHANGELOG.md) 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](https://nodejs.org/en/about/releases/), focusing on- Maintenance LTS
- Active LTS
- Current## Contributing to this project
Please read our [contribution guide](./CONTRIBUTING.md) 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.