passport-xero-oauth2

0.0.3 • Public • Published

passport-xero-oauth2

This is a Xero OAuth2 authentication strategy for Passport.js. Passport is authentication middleware for Node.js that can be unobtrusively dropped into any Express-based web application.

Build Status npm License

Table of Contents

Installation

The Xero Passport strategy is installed with npm.

npm install passport-xero-oauth2

Customization

State parameter

The Xero Passport strategy enforces the use of the state parameter in OAuth 2.0 authorization requests and requires session support in Express to be enabled.

If you require the state parameter to be omitted (which is not recommended), you can suppress it when calling the Xero Passport strategy constructor:

const XeroStrategy = require('passport-xero-oauth2');
const strategy = new XeroStrategy({
     // ...
     state: false
  },
  function(accessToken, refreshToken, extraParams, profile, done) {
    // ...
  }
);

Scopes

If you want to change the scope of the ID token provided, add a scope property to the authenticate configuration passed when defining the route.

app.get(
	'/login',
	passport.authenticate('xero', {scope: 'openid email profile'}),
	function (req, res) {
		res.redirect('/');
	}
);

License

This project is licensed under the MIT license. See the LICENSE file for more info.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.3149latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.3149
0.0.20
0.0.10

Package Sidebar

Install

npm i passport-xero-oauth2

Weekly Downloads

149

Version

0.0.3

License

MIT

Unpacked Size

15.4 kB

Total Files

10

Last publish

Collaborators

  • theadmin