passport-redgate

A passport provider for Red Gate ID

passport-redgate

A passport provider for Red Gate ID. There is a full working express app in the example directory.

npm install passport-redgate
var RedGateStrategy = require('passport-redgate')
 
passport.use(new RedGateStrategy({
    returnURL: 'http://localhost:3000/login',
    realm: 'http://localhost:3000/'
  },
  function(userdone) {
    //user has {id: '<guid>', openID: '<uri>'} 
    User.findByOpenID({ openId: user.openID }, function (erruser) {
      return done(err, user);
    });
  }
));
 
 
app.get('/login', passport.authenticate('redgate'), function(reqres){
  // Successful authentication, redirect home. 
  res.redirect('/');
});
var RedGateStrategy = require('passport-redgate')
 
passport.use(new RedGateStrategy({
    auth: {user: 'username', pass: 'password'},
    returnURL: 'http://localhost:3000/login',
    realm: 'http://localhost:3000/'
  },
  function(userdone) {
    //user has {id: '<guid>', openID: '<uri>', 
    //          emailAddress: 'foo@red-gate.com', 
    //          emailAddressConfirmed: true} 
    done(user)
  }
));
 
 
app.get('/login', passport.authenticate('redgate'), function(reqres){
  // Successful authentication, redirect home. 
  res.redirect('/');
});

MIT