Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

passport-ldapauth

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-ldapauth - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

14

package.json

@@ -15,3 +15,3 @@ {

],
"version": "0.2.0",
"version": "0.2.1",
"license": {

@@ -33,11 +33,15 @@ "type": "MIT",

"dependencies": {
"ldapauth-fork": "~2.2.5",
"ldapauth-fork": "~2.2.13"
},
"peerDependencies": {
"passport": "~0.2.0"
},
"devDependencies": {
"mocha": "1.17.x",
"body-parser": "1.3.x",
"chai": "1.9.x",
"express": "4.4.x",
"ldapjs": "0.7.x",
"express": "3.4.x",
"supertest": "0.9.x"
"mocha": "1.20.x",
"supertest": "0.13.x",
"passport": "~0.2.0"
},

@@ -44,0 +48,0 @@ "scripts": {

@@ -5,7 +5,11 @@ var express = require('express'),

var log4js = require('log4js');
var logger = log4js.getLogger();
var OPTS = {
server: {
url: 'ldap://localhost:12345',
url: 'ldap://localhost:1389',
searchBase: 'ou=passport-ldapauth',
searchFilter: '(uid={{username}})'
searchFilter: '(uid={{username}})',
log4js: log4js
}

@@ -16,15 +20,45 @@ };

passport.use(new LdapStrategy(OPTS));
passport.serializeUser(function(user, done) {
console.log('user : ' + user);
console.log('done : ' + done);
console.log('serializeUser was called');
done(null, 1);
});
app.configure(function() {
app.use(express.bodyParser());
app.use(passport.initialize());
passport.deserializeUser(function(obj, done) {
console.log('deserializeUser was called');
done(null, obj);
});
passport.use(new LdapStrategy(OPTS, function(user, done) {
done(null, user);
}));
app.use(require('cookie-parser')());
app.use(require('body-parser').json());
app.use(require('express-session')({
secret: 'secret',
store: new require('express-session').MemoryStore()
}))
app.use(passport.initialize());
app.use(passport.session());
app.all('*', function(req, res, next) {
console.log('Request');
console.log('Request', req.headers, req.body);
next();
});
app.post('/login', passport.authenticate('ldapauth', {session: false}), function(req, res) {
app.get('/login', function(req, res) {
console.log('GET');
if (req.user) {
console.log('OK');
res.send(200, {status: 'ok'});
} else {
console.log('NOK');
res.send(403);
}
});
app.post('/login', passport.authenticate('ldapauth'), function(req, res) {
console.log('POST');
res.send({status: 'ok'});

@@ -31,0 +65,0 @@ });

var express = require('express'),
passport = require('passport'),
LdapStrategy = require('passport-ldapauth').Strategy;
LdapStrategy = require('passport-ldapauth').Strategy,
bodyParser = require('body-parser');

@@ -23,6 +24,4 @@ var server = null;

app.configure(function() {
app.use(express.bodyParser());
app.use(passport.initialize());
});
app.use(bodyParser());
app.use(passport.initialize());

@@ -29,0 +28,0 @@ app.post('/login', passport.authenticate('ldapauth', {session: false}), function(req, res) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc