Skip to content

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

License

Notifications You must be signed in to change notification settings

laverite/koa-oauth-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Koa OAuth Server Build Status

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

This is the koa wrap for: https://github.com/thomseddon/node-oauth2-server

Installation

$ npm install koa-oauth-server

Quick Start

The module provides a single middleware:

var koa = require('koa');
var oauthserver = require('koa-oauth-server');

var app = koa();

app.oauth = oauthserver({
  model: {}, // See https://github.com/thomseddon/node-oauth2-server for specification
  grants: ['password'],
  debug: true
});

app.use(app.oauth.authorise());

app.use(function *(next) {
  this.body = 'Secret area';
  yield next;
});

app.listen(3000);

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.7%
  • Makefile 0.3%