node package manager


Express OAuth Server Build Status

Complete, compliant and well tested module for implementing an OAuth2 Server/Provider with express in node.js.

This is the express wrapper for oauth2-server.


$ npm install @bcoe/express-oauth-server

Quick Start

The module provides two middlewares - one for granting tokens and another to authorise them. @bcoe/express-oauth-server and, consequently oauth2-server, expect the request body to be parsed already. The following example uses body-parser but you may opt for an alternative library.

var bodyparser = require('body-parser');
var express = require('express');
var OAuthServer = require('@bcoe/express-oauth-server');
var app = express();
app.oauth = new OAuthServer({
  model: {}, // See for specification 
app.use(bodyparser.urlencoded({ extended: false }))
app.use(function(req, res) {
  res.send('Secret area');