Nurturing Pluto's Martians

    This package has been deprecated

    Author message:

    Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

    passport-cloudup

    0.1.0 • Public • Published

    passport-cloudup

    Build Status NPM version

    Cloudup authentication for Passport

    This module is based off passport-github

    Install

    $ npm install passport-cloudup --save

    Usage

    Configure Strategy

    Cloudup uses OAuth 2.0 tokens to authenticate a registered Cloudup user. The returned profile contains the full Cloudup API user data.

     
    passport.use(new cloudupStrategy({
      clientID: clientID,
      clientSecret: clientSecret,
      callbackURL: "/auth/cloudup/callback"
    },
    function(accessToken, refreshToken, profile, done){
     
      User.findOrCreate({cloudupId: profile.id}, function (err, user) {
        return done(err, user);
      });
     
    }));
     

    Authenticate Requests

    Using express or connect-like middleware, specify the auth type of cloudup

     
    app.get('/auth/cloudup', passport.authenticate('cloudup'));
     
    app.get('/auth/cloudup/callback',
      passport.authenticate('cloudup'), function(req, res){
        if (req.user){
          res.redirect('/');
        }
        else {
          res.redirect('/login');
        }
      }
    );
     

    Examples

    A full authentication example can be found here

    Tests

    $ npm install --dev
    $ npm test

    LICENSE MIT

    Install

    npm i passport-cloudup

    DownloadsWeekly Downloads

    0

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • stevelacy