Distimo authentication strategy for Passport.


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

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

$ npm install passport-distimo

There are no user profiles in Distimo API. So the profile will always be an empty object.

passport.use(new DistimoStrategy({
    clientSecret: DISTIMO_CLIENT_SECRET,
    callbackURL: ''
  function(accessToken, refreshToken, profile, done) {
    // profile is an empty object
    // Process accessToken and refreshToken

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

For example, as route middleware in an Express application:

app.get('/auth/distimo', passport.authenticate('distimo'));

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

The MIT License

Copyright (c) 2014 Konstantin Tsabolov <LinkedIn profile>