passport-beatport

0.0.2 • Public • Published

Passport-Beatport.com

Passport strategy for authenticating with Beatport using the OAuth 1.0 API.

Install

$ npm install passport-beatport

Usage

Configure Strategy

var BeatportStartegy = require('passport-beatport').Strategy;

passport.use(new BeatportStartegy({
    consumerKey: EXAMPLE_CONSUMER_KEY,
    consumerSecret: EXAMPLE_CONSUMER_SECRET, 
    callbackURL: 'https://www.example.net/auth/beatport/callback'
  },
  function(token, tokenSecret, profile, done) {
    User.findOrCreate(..., function (err, user) {
      done(err, user);
    });
  }
));

Authenticate Requests

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

For example, as route middleware in an Express application:

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

app.get('/auth/beatport/callback', 
  passport.authenticate('beatport', { failureRedirect: '/login' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });

Credits

License

The MIT License

Copyright (c) 2013 Jakub Jelen

/passport-beatport/

    Package Sidebar

    Install

    npm i passport-beatport

    Weekly Downloads

    1

    Version

    0.0.2

    License

    none

    Last publish

    Collaborators

    • fastman