Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    passport-beatportpublic

    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

    Keywords

    none

    install

    npm i passport-beatport

    Downloadsweekly downloads

    4

    version

    0.0.2

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar