Skip to content

siacomuzzi/passport-ip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An IP based authentication passport strategy.

Installation

npm i eugeniop/passport-ip --save

Usage

Register the strategy in passport as follows:

var passport = require('passport');
var IpStrategy = require('passport-ip').Strategy;

passport.use(new IpStrategy({
  range: '10.0.0.0/8'
}, function(profile, done){
  done(null, profile);
  //profile.id is the ip address.
}));

Configuration behind a proxy

If you are running your express application behind a proxy that you trust:

app.enable('trust proxy');

Then passport-ip will use the X-Forwarded-For header.

License

MIT 2014 Eugenio Pace

About

An IP based authentication passport strategy

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 95.7%
  • Makefile 4.3%