Koa OAuth Server
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: {},
grants: ['password'],
debug: true
});
app.use(app.oauth.authorise());
app.use(function *(next) {
this.body = 'Secret area';
yield next;
});
app.listen(3000);