auth0 / passport-windowsauth

Windows Authentication strategy for Passport.js
MIT License
179 stars 51 forks source link

Live LDAP example #27

Open pablodenadai opened 9 years ago

pablodenadai commented 9 years ago

I'd be very nice to have a simple working live example.

gausie commented 9 years ago

:+1:

SaschaHenning commented 3 years ago

Windows has a tool to test LDAP connections. You can find it here: "C:\Windows\System32\ldp.exe". Use Connection - Bind - "Simple bind" to test your account. Provide the account in the format shown below in the sample.

Here a working LDAP configuration tested directly on an AD Controller (thus localhost, use DNS name or IP of AD Controller if on a different machine):

passport.use(new WindowsStrategy({ integrated:true,ldap: {
    url:             'ldap://localhost:389',
    base:            'DC=jasp,DC=local',
    bindDN:          'jasp\\AccountWithDomainReadRights',
    bindCredentials: 'Password'
  } },function(profile, done){ 
   // at this point you can access the "profile"
    done()
}));