Skip to content
Chained token exchange for OAuth2orize.
Find file
Latest commit 6d102fe @jaredhanson Bump to version 0.1.0.
Failed to load latest commit information.
lib Add comments.
support/mk Initial commit.
test Delint tests.
.gitignore Initial commit.
.jshintrc Initial commit.
.npmignore Initial commit.
.travis.yml Disable node 0.6 on Travis CI.
LICENSE Initial commit.
Makefile Stub out test cases. Update README.
package.json Bump to version 0.1.0.


Build Coverage Quality Dependencies Tips

Chained token exchange for OAuth2orize.

This exchange is used to exchange an access token issued by an OAuth domain for a chained access token, potentially issued by a different OAuth domain. This scenario facilitiates service chaining, in which one service needs to communicate with another service in order to fulfill the original request.


$ npm install oauth2orize-chain


Register Exchange

Register the exchange with an OAuth 2.0 server.

var chain = require('oauth2orize-chain').exchange.chain;'', chain(function(client, scheme, credential, scope, done) {
  AccessToken.verify(credential, function(err, t) {
    if (err) { return done(err); }

    var token = utils.uid(256);
    var at = new AccessToken(token, t.userId,, t.scope); {
      if (err) { return done(err); }
      return done(null, token);


This module is implemented based on Chain Grant Type for OAuth2, Draft 01. Implementers are encouraged to track the progress of this specification and update update their implementations as necessary. Furthermore, the implications of relying on a non-final draft specification should be understood prior to deployment.

Related Modules


$ npm install
$ npm test



The MIT License

Copyright (c) 2014 Jared Hanson <>

Something went wrong with that request. Please try again.