node package manager

passport-maltio (OAuth2) authentication strategy for Passport.js


Passport strategies for authenticating with using OAuth 2.0.

This module lets you authenticate using in your Node.js applications. By plugging into Passport, authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.

$ npm install passport-maltio

The OAuth 2.0 authentication strategy authenticates users using a account and OAuth 2.0 tokens. The strategy requires a verify callback, which accepts these credentials and calls done providing a user, as well as options specifying a client ID, client secret, and callback URL.

var MaltioStrategy = require('passport-maltio');
passport.use(new MaltioStrategy({
    clientSecret: MALTIO_CLIENT_SECRET,
    callbackURL: ""
  function(accessToken, refreshToken, profile, done) {
    User.findOrCreate({ externalId: }, function (err, user) {
      return done(err, user);

Use passport.authenticate(), specifying the 'maltio' strategy, to authenticate requests.

For example, as route middleware in an Express application:

  passport.authenticate('maltio', { failureRedirect: '/login' }),
  function(req, res) {
    // Successful authentication, redirect home. 

Now, to log in a user

For a complete, working example, refer to the example directory.

The MIT License

Copyright (c) 2013 Daniel G. Taylor