Skip to content

Workable/passport-xero-oauth2-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Passport strategy for authenticating with Xero using the OAuth 2.0 API.

Installation

$ npm install @workablehr/passport-xero-oauth2-v2

Usage

This module is based on Passport OAuth2 module. It is used in the same way as other Passport strategies.

Example:

passport.use(new XeroStrategy({
    clientId: XERO_CLIENT_ID,
    clientSecret: XERO_CLIENT_SECRET,
    callbackURL: "http://yourapp.io/auth/xero/callback",
    passReqToCallback: true
  },
  function(request, accessToken, refreshToken, profile, done) {
    User.findOrCreate({ xero_id: profile.xero_userid }, function (err, user) {
      return cb(err, user);
    });
  }
));

About

Passport strategy for authenticating with Xero

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published