passport-http-signature

Passport strategy using HTTP Signatures

NPM Version Linux Build Test Coverage

Install

npm install --save passport-http-signature

Usage

Configure Strategy

passport.use(new HTTPSignatureStrategy(
  function (username, done) {
    User.findById(username, function(err, user) {
      if (err) return done(err)
      if (!user) return done()
      done(null, user, user.public_key)
    })
  }))

Authenticate Requests

app.get('/private',
  passport.authenticate('http-signature'),
  function(req, res) {
    res.json(req.user)
  })

License

MIT

Supported by

SEARCH FOR STRATEGIES

0STRATEGIES