passport-ldapauth
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -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); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15533
346
98
+ Addedasn1@0.2.1(transitive)
+ Addedassert-plus@0.1.40.1.5(transitive)
+ Addedbackoff@2.3.0(transitive)
+ Addedbcrypt@0.8.7(transitive)
+ Addedbindings@1.2.1(transitive)
+ Addedbunyan@0.22.1(transitive)
+ Addeddtrace-provider@0.2.8(transitive)
+ Addedextsprintf@1.0.0(transitive)
+ Addedjson-schema@0.2.2(transitive)
+ Addedjsprim@0.3.0(transitive)
+ Addedldapauth@2.3.1(transitive)
+ Addedldapjs@0.7.1(transitive)
+ Addedlru-cache@2.0.4(transitive)
+ Addedmv@0.0.5(transitive)
+ Addednan@2.3.5(transitive)
+ Addednopt@2.1.1(transitive)
+ Addedonce@1.3.0(transitive)
+ Addedpooling@0.4.6(transitive)
+ Addedvasync@1.4.0(transitive)
+ Addedverror@1.1.01.3.3(transitive)
- Removedasn1@0.1.10(transitive)
- Removedbcrypt@0.5.0(transitive)
- Removedbuffertools@1.0.5(transitive)
- Removeddtrace-provider@0.0.3(transitive)
- Removedldapauth@2.0.0(transitive)
- Removedldapjs@0.3.6(transitive)
- Removedlru-cache@1.0.5(transitive)
- Removednopt@1.0.10(transitive)
- Removedsprintf@0.1.1(transitive)
Updatedldapauth@>=2.0.0