node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

passport-wpoauth

passport-wpoauth

NPM version Build Status Coverage Status Code Climate Dependency Status

A authentication strategy for Passport against a Wordpress OAuth Server.

Install

$ npm install --save passport-wpoauth

Usage

var passport =  require('passport'),
    WPOAuthStrategy = require('passport-wpoauth');
    
passport.use(new WPOAuthStrategy({
  clientID: '123abc456def789ghi',
  clientSecret: 'shhh-its-a-secret',
  callbackURL: 'https://www.example.net/auth/wpoauth/callback',
  authorizationURL: 'https://www.example.net/blog/oauth/authorize',
  tokenURL: 'https://www.example.net/blog/oauth/token',
  userProfileURL: 'https://www.example.net/blog/oauth/me'
  }, function(accessToken, refreshToken, profile, done) {
    User.findOrCreate(..., function(err, user) {
      ...
      done(err, user);
    });
  }
));

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.

Conspirators

A HUGE thanks to Jared Hanson, i used passport-github as a guideline.

License

Copyright (c) 2015 Thomas Lercher. Licensed under the MIT license.