MCPcopy
hub / github.com/oauthjs/node-oauth2-server

github.com/oauthjs/node-oauth2-server @v3.1.1 sqlite

repository ↗ · DeepWiki ↗ · release v3.1.1 ↗
37 symbols 51 edges 62 files 34 documented · 92%
README

oauth2-server

npm Version npm Downloads Test Status MIT Licensed oauthjs Slack

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

Note: After a period of hiatus, this project is now back under active maintenance. Dependencies have been updated and bug fixes will land in v3 (current master). v4 will be mostly backwards compatible with no code changes required for users using a supported node release. More details in #621.

Installation

npm install oauth2-server

The oauth2-server module is framework-agnostic but there are several officially supported wrappers available for popular HTTP server frameworks such as Express and Koa. 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, Node-style callbacks, ES6 generators and async/await (using Babel).
  • Fully RFC 6749 and RFC 6750 compliant.
  • Implicitly supports any form of storage, e.g. PostgreSQL, MySQL, MongoDB, Redis, etc.
  • Complete test suite.

Documentation

Documentation is hosted on Read the Docs.

Examples

Most users should refer to our Express or Koa examples.

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

Upgrading from 2.x

This module has been rewritten using a promise-based approach, introducing changes to the API and model specification. v2.x is no longer supported.

Please refer to our 3.0 migration guide for more information.

Tests

To run the test suite, install dependencies, then run npm test:

npm install
npm test

Core symbols most depended-on inside this repo

generateBaseRequest
called by 13
test/unit/request_test.js
generateBaseResponse
called by 9
test/unit/response_test.js
load_package_json
called by 1
docs/npm_conf.py
get_short_version
called by 1
docs/npm_conf.py
get_copyright_year
called by 1
docs/npm_conf.py
Request
called by 0
lib/request.js
Response
called by 0
lib/response.js
OAuth2Server
called by 0
lib/server.js

Shape

Function 37

Languages

TypeScript86%
Python14%

Modules by API surface

docs/npm_conf.py4 symbols
test/unit/response_test.js1 symbols
test/unit/request_test.js1 symbols
lib/token-types/mac-token-type.js1 symbols
lib/token-types/bearer-token-type.js1 symbols
lib/server.js1 symbols
lib/response.js1 symbols
lib/response-types/token-response-type.js1 symbols
lib/response-types/code-response-type.js1 symbols
lib/request.js1 symbols
lib/models/token-model.js1 symbols
lib/handlers/token-handler.js1 symbols

Dependencies from manifests, versioned

basic-auth2.0.1 · 1×
bluebird3.7.2 · 1×
jshint2.11.1 · 1×
lodash4.17.19 · 1×
mocha5.2.0 · 1×
promisify-any2.0.1 · 1×
should13.2.3 · 1×
sinon7.5.0 · 1×
statuses1.5.0 · 1×
type-is1.6.18 · 1×

For agents

$ claude mcp add node-oauth2-server \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact