diff --git a/src/config_passport.js b/src/config_passport.js index d8296e5c0f167ef916f59ef9ea74eb41b1a7a5b9..342634e2e6dfef1084da804c23c1737f0121495d 100644 --- a/src/config_passport.js +++ b/src/config_passport.js @@ -34,6 +34,8 @@ import passport from 'passport'; import LdapStrategy from 'passport-ldapauth'; import { ldapConfig } from './ldap/internal/config'; +console.log("Configuring passportjs... " + ldapConfig.server + " " + ldapConfig.dn.user); + // specifies options for 'ldapauth' strategy, to customize the behaviour of subsequent passport.authenticate('ldapauth') calls passport.use(new LdapStrategy({ server: { @@ -41,7 +43,7 @@ passport.use(new LdapStrategy({ //bindDn: '.............', //bindCredentials: '..........', searchBase: ldapConfig.dn.user, // this field cannot be left empty. - searchFilter: '(uid={{username}})', // this field cannot be left empty. + searchFilter: '(uid={{username}}*)', // this field cannot be left empty. searchAttributes: ['uid', 'urlPhoto'], // only fetch the uid, no need for any other field //tlsOptions: '..........', //https://www.npmjs.com/package/passport-ldapauth for more