All Projects → bhoriuchi → passport-activedirectory

bhoriuchi / passport-activedirectory

Licence: other
Active Directory strategy for passport.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to passport-activedirectory

IDVerification
"Very simple but works well" Computer Vision based ID verification solution provided by LibraX.
Stars: ✭ 44 (+57.14%)
Mutual labels:  verification, passport
passport-yandex
Yandex authentication strategy for Passport and Node.js.
Stars: ✭ 19 (-32.14%)
Mutual labels:  passport, strategy
crimson-spray
A lockout aware password sprayer
Stars: ✭ 11 (-60.71%)
Mutual labels:  active-directory
laravel-otp-login
Adds a customizable, translatable, configurable OTP verification step to Laravel Auth. You can add your own SMS provider too.
Stars: ✭ 16 (-42.86%)
Mutual labels:  verification
receptacle
minimalistic implementation of the repository pattern
Stars: ✭ 18 (-35.71%)
Mutual labels:  strategy
vue-nuxt-passport-bulma-express-boiler
A Vue+Vuex starter with Nuxt scaffolding, Bulma styling, and Express backend.
Stars: ✭ 21 (-25%)
Mutual labels:  passport
NSE-Stock-Scanner
National Stock Exchange (NSE), India based Stock screener program. Supports Live Data, Swing / Momentum Trading, Intraday Trading, Connect to online brokers as Zerodha Kite, Risk Management, Emotion Control, Screening, Strategies, Backtesting, Automatic Stock Downloading after closing, live free day trading data and much more
Stars: ✭ 78 (+178.57%)
Mutual labels:  strategy
egg-passport-local
wrap passport-local strategy for egg-passport
Stars: ✭ 44 (+57.14%)
Mutual labels:  passport
DocumentReader-iOS
iOS Framework for reading and validation of identification documents
Stars: ✭ 54 (+92.86%)
Mutual labels:  verification
hyouka
Um bot open-source com dashboard incluída
Stars: ✭ 12 (-57.14%)
Mutual labels:  passport
PSPasswordExpiryNotifications
Following PowerShell Module provides different approach to scheduling password notifications for expiring Active Directory based accounts. While most of the scripts require knowledge on HTML... this one is just one config file and a bit of tingling around with texts. Whether this is good or bad it's up to you to decide. I do plan to add an optio…
Stars: ✭ 38 (+35.71%)
Mutual labels:  active-directory
DeepIPR
This is the code repo of our NeurIPS2019 work that proposes novel passport-based DNN ownership verification schemes, i.e. we embed passport layer into various deep learning architectures (e.g. AlexNet, ResNet) for Intellectual Property Right (IPR) protection.
Stars: ✭ 63 (+125%)
Mutual labels:  passport
KWVerificationCodeView
A customisable verification code view to capture OTPs
Stars: ✭ 83 (+196.43%)
Mutual labels:  verification
On-The-Roadside
A turn-based ASCII strategy game.
Stars: ✭ 21 (-25%)
Mutual labels:  strategy
ActiveDirectoryEnumeration
Enumerate AD through LDAP with a collection of helpfull scripts being bundled
Stars: ✭ 127 (+353.57%)
Mutual labels:  active-directory
verify-apple-id-token
Verify the Apple id token on the server side.
Stars: ✭ 49 (+75%)
Mutual labels:  verification
significa.co
Significa - A digital design-led agency focused on product development.
Stars: ✭ 72 (+157.14%)
Mutual labels:  strategy
oh-my-design-patterns
🎨 Record the articles and code I wrote while learning design patterns
Stars: ✭ 33 (+17.86%)
Mutual labels:  strategy
qcec
MQT QCEC - A tool for Quantum Circuit Equivalence Checking
Stars: ✭ 64 (+128.57%)
Mutual labels:  verification
active-directory-lookup
Simplest Java API (and CLI) for authenticating and searching in Active Directory
Stars: ✭ 15 (-46.43%)
Mutual labels:  active-directory

passport-activedirectory

Active Directory strategy for passport.js


This Strategy is a "fork" of passport-windowsauth that uses the activedirectory module instead of directly calling ldapjs.

The module works almost identically except that the verify function is passed the ActiveDirectory object as a parameter so that you can use the query functions included in activedirectory during verification. This is useful when using nested AD groups where you want to identify if a user is a member of a root level group.

Example

Setup

var passport = require('passport')
var ActiveDirectoryStrategy = require('passport-activedirectory')

passport.use(new ActiveDirectoryStrategy({
  integrated: false,
  ldap: {
    url: 'ldap://my.domain.com',
    baseDN: 'DC=my,DC=domain,DC=com',
    username: '[email protected]',
    password: 'readuserspassword'
  }
}, function (profile, ad, done) {
  ad.isUserMemberOf(profile._json.dn, 'AccessGroup', function (err, isMember) {
    if (err) return done(err)
    return done(null, profile)
  })
}))

Protecting a path

var opts = { failWithError: true }
app.post('/login', passport.authenticate('ActiveDirectory', opts), function(req, res) {
  res.json(req.user)
}, function (err) {
  res.status(401).send('Not Authenticated')
})

// example request
// > curl -H "Content-Type: application/json" -X POST -d '{"username":"xyz","password":"xyz"}' http://localhost/login

Optionally reuse an existing instance of activedirectory

var passport = require('passport')
var ActiveDirectoryStrategy = require('passport-activedirectory')
var ActiveDirectory = require('activedirectory')

var ad = new ActiveDirectory({
  url: 'ldap://my.domain.com',
  baseDN: 'DC=my,DC=domain,DC=com',
  username: '[email protected]',
  password: 'readuserspassword'
})

passport.use(new ActiveDirectoryStrategy({
  integrated: false,
  ldap: ad
}, function (profile, ad, done) {
  ad.isUserMemberOf(profile._json.dn, 'AccessGroup', function (err, isMember) {
    if (err) return done(err)
    return done(null, profile)
  })
}))

API

ActiveDirectoryStrategy ( options, verify )

  • options { Object } - Options for connecting and verification
    • [integrated=true] { Boolean } - Use windows integrated login. For username and password authentication set this to false
    • [passReqToCallback=false] { Boolean } - Pass the request to the callback
    • [usernameField="username"] { String } - request body field to use for the username
    • [passwordField="password"] { String } - request body field to use for the password
    • [mapProfile] { Function } - Custom profile mapping function. Takes user object as only parameter and returns a profile object. _json is added to the object with the full object
    • [ldap] { Object | ActiveDirectory } - LDAP connection object. Extended properties are documented here. You may also supply an instance of activedirectory instead.
      • url { String } - LDAP URL (e.g. ldap://my.domain.com)
      • baseDN { String } - Base LDAP DN to search for users in
      • username { String } - User name of account with access to search the directory
      • password { String } - Password for username
      • [filter] { Function } - Takes username as its only parameter and returns an ldap query for that user
      • [attributes] { Array } - Array of attributes to include in the profile under the profile._json key. The dn property is always added because it is used to authenticate the user
  • verify { Function } - Verification function. Depending on the options supplied the signature will be one of the following
    • Signatures
      • verify ( profile, ad, done ) - Using ldap
      • verify( req, profile, ad, done ) - Using ldap and with the passReqToCallback option set to true
      • verify ( profile, done ) - Not using ldap
      • verify ( req, profile, done ) - Not using ldap and with the passReqToCallback option set to true
    • Params
      • profile { Object } - User profile object
      • req { Object } - request object
      • ad { Object } - ActiveDirectory instance
      • done { Function } - Passport callback

More Information

  • For information on setting up integrated authentication with IIS and Apache, review the documentation at passport-windowsauth
  • For more information on ActiveDirectory methods review activedirectory
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].