Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including passport-wpoauth with all npm packages installed. Try it out:

var passportWpoauth = require("passport-wpoauth")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

passport-wpoauth v1.2.3

Authentication strategy for Passport for Wordpress with WP-OAuth plugin.

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.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free