Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

passport-ip

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-ip

IP based authentication strategy for Passport.

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

An IP based authentication passport strategy.

This repository was forked from https://github.com/eugeniop/passport-ip and modified slightly.

Installation

npm i 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 2016 Anthony Liatsis

Keywords

passport

FAQs

Package last updated on 05 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts