I am currently trying to implement implement ldap authentication using passport js. Now if I try to add passport configuration outside app file : for example config/passport
const opts = {
server: {
},
credentialsLookup: basicAuth
};
module.exports = (passport) => {
passport.use(new LdapStrategy(opts));
}
and import config using require('./config/passport')(passport); then it is not working and says missing credential from authenticate middleware.
But if I put options in app.ts file and initialise strategy in app.ts file then it works perfectly fine.