Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
passport-ding-ldapjs
Advanced tools
Passport strategy for authenticating against an LDAP server.
Tested with OpenLDAP server and Windows Server 2013 Active Directory
$ npm install passport-ldapjs
The strategy requires a verify
callback which accepts a user profile
entry from the directory, and then calls the done
callback supplying a user
.
var LdapStrategy = require('passport-ldapjs').Strategy;
var opts = {
server: {
url: 'ldap://0.0.0.0:1389',
},
base: 'OU=Users,OU=Company,DC=company,DC=com',
search: {
filter: '(sAMAccountName={{username}})',
attributes: ['displayName', 'givenName', 'mail', 'title', 'telephoneNumber', 'physiscalDeliveryOfficeName', 'userPrincipalName', 'sAMAccountName'],
scope: 'sub'
},
uidTag: 'cn',
usernameField: 'email',
passwordField: 'passwd',
};
passport.use(new LdapStrategy(opts, function(profile, done) {
User.findOne({email: email}, '-salt -password', function(err, user) {
if (err) {
return done(err);
}
if (user) {
return done(null, user);
} else {
return done('User not found');
}
});
}));
Use passport.authenticate()
, specifying the 'ldap'
strategy, to authenticate requests.
For example, as route middleware in an Express application:
// Create route
app.post('/login', passport.authenticate('ldap', {
successReturnToOrRedirect: '/',
failureRedirect: '/login',
failureFlash: true
}));
Copyright (c) 2015 Trinh Phuoc Thai <http://tphuocthai.com/>
FAQs
NodeJS Passport LDAP authentication using ldapjs
The npm package passport-ding-ldapjs receives a total of 0 weekly downloads. As such, passport-ding-ldapjs popularity was classified as not popular.
We found that passport-ding-ldapjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.