private npm is here.

publish unlimited private modules for just $7/month

simple ouath2 implementation for use with restify or any other connect style node server

If you are a robot, enter text here

OAuthenticity.js

A simple, customizable oauth2 provider for connect style node servers. Existential abstracts way the annoying validation
and flow of the Oauth2 spec and lets you just plugin in your specific business logic. It is mean to be easy and only
as opinionated as needed to still be oauth2

###Use

The actual creation of an oauth2 provider is fairly trivial. Rather then automatically adding routes, and middleware
the createOauth2Provider() method will return a set of functions that do the necessary work. This decouples oauthenticity
from any specific web server implementation

All returned function have the same signature, each takes a node request, response object, and a third cb or callback
function. this should look familiar to anyone using Express or Restify, which allows you to simply pass the
functions to the routes and middleware chain

grants: (Array) specify which grants you wish to use es: ["authorization_grant", "password"]

allowImplicit: (Boolean) whether to allows implicit token granting, for the authorization_code grant. If true
you will be able to do response_type=token when making a request to the authorization endpoint

Hooks are a set of functions that you insert your application logic into the auth process. OAuthenticity will call the appropriate hook
when it needs information. It is up to you to generate and store tokens, validate the requesting client/resource owner etc.
Each grant type requires a different set of hooks, although there is some overlap.