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

passport-ldap

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-ldap

LDAP authentication strategy for Passport.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

Passport-LDAP

Passport strategy for authenticating against an OpenLDAP server.

This module lets you authenticate against an OpenLDAP server in your Node.js applications. By plugging into Passport, LDAP authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.

Install

$ npm install passport-ldap

Usage

Configure Strategy

The LDAP authentication strategy authenticates requests by delegating to the given ldap server using the openldap protocol.

The strategy requires a verify callback which accepts a user profile entry from the directory, and then calls the done callback supplying a user.

passport.use(new LDAPStrategy({
    url: 'ldap://0.0.0.0:1389',
    base: 'o=example',
    search: {
      filter: '(&(l=Seattle)(email=*@foo.com))',
     }
  },
  function(profile, done) {
    return done(null, profile);
  }
));
Authenticate Requests

Use passport.authenticate(), specifying the 'ldap' strategy, to authenticate requests.

For example, as route middleware in an Express application:

app.get('/auth/login',
  passport.authenticate('facebook'));

app.post('/auth/ldap',
  passport.authenticate('ldap', {
    successRedirect: '/',
    failureRedirect: '/auth/login/'
  })
);
Profile Fields

Examples

For a complete, working example, refer to the login example.

Tests

$ npm install --dev
$ make test

Build Status

Credits

License

The MIT License

Copyright (c) 2011-2013 Paul Dixon <http://www.mintbridge.co.uk/>

Keywords

FAQs

Package last updated on 24 Feb 2013

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

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