Skip to content
A passport provider for RedGate's OpenID system
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
example
test
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

passport-redgate

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

Build Status Dependency Status NPM version

Installation

npm install passport-redgate

Example

var RedGateStrategy = require('passport-redgate')

passport.use(new RedGateStrategy({
    returnURL: 'http://localhost:3000/login',
    realm: 'http://localhost:3000/'
  },
  function(user, done) {
    //user has {id: '<guid>', openID: '<uri>'}
    User.findByOpenID({ openId: user.openID }, function (err, user) {
      return done(err, user);
    });
  }
));


app.get('/login', passport.authenticate('redgate'), function(req, res){
  // Successful authentication, redirect home.
  res.redirect('/');
});

Example with e-mail

var RedGateStrategy = require('passport-redgate')

passport.use(new RedGateStrategy({
    auth: {user: 'username', pass: 'password'},
    returnURL: 'http://localhost:3000/login',
    realm: 'http://localhost:3000/'
  },
  function(user, done) {
    //user has {id: '<guid>', openID: '<uri>',
    //          emailAddress: 'foo@red-gate.com',
    //          emailAddressConfirmed: true}
    done(user)
  }
));


app.get('/login', passport.authenticate('redgate'), function(req, res){
  // Successful authentication, redirect home.
  res.redirect('/');
});

License

MIT

Something went wrong with that request. Please try again.