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.0.3 to 0.0.4

4

package.json

@@ -11,3 +11,3 @@ {

],
"version": "0.0.3",
"version": "0.0.4",
"license": {

@@ -29,3 +29,3 @@ "type": "MIT",

"dependencies": {
"ldapauth": "~2.0.0",
"ldapauth": ">=2.0.0",
"passport": "~0.1.1"

@@ -32,0 +32,0 @@ },

@@ -30,2 +30,3 @@ # passport-ldapauth

function(user, done) {
...
return done(null, user);

@@ -52,4 +53,10 @@ }

* `passwordField`: Field name where the password is found, defaults to _password_
* `passReqToCallback` when `true`, `req` is the first argument to the verify callback (default: `false`)
* `passReqToCallback`: When `true`, `req` is the first argument to the verify callback (default: `false`):
passport.use(new LdapStrategy(..., function(req, user, done) {
...
done(null, user);
}
));
## Express example

@@ -56,0 +63,0 @@

@@ -128,6 +128,29 @@ var should = require('chai').Should(),

.expect(200)
.end(cb);
.end(function() {
delete OPTS.usernameField;
delete OPTS.passwordField;
cb();
});
});
});
it("should pass request to verify callback if defined so", function(cb) {
OPTS.passReqToCallback = true;
var req = {body: {username: 'valid', password: 'valid', testkey: 1}},
s = new LdapStrategy(OPTS, function(req, user, done) {
req.should.have.keys('body');
req.body.should.have.keys(['username', 'password', 'testkey']);
done(null, user);
});
s.success = function(user) {
should.exist(user);
user.uid.should.equal('valid');
delete OPTS.passReqToCallback;
cb();
};
s.authenticate(req);
});
});
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