|
@@ -115,6 +115,10 @@ class PassportService {
|
|
|
passport.use(new LdapStrategy(this.getLdapConfigurationFunc(config, {passReqToCallback: true}),
|
|
passport.use(new LdapStrategy(this.getLdapConfigurationFunc(config, {passReqToCallback: true}),
|
|
|
(req, ldapAccountInfo, done) => {
|
|
(req, ldapAccountInfo, done) => {
|
|
|
debug('LDAP authentication has succeeded', ldapAccountInfo);
|
|
debug('LDAP authentication has succeeded', ldapAccountInfo);
|
|
|
|
|
+
|
|
|
|
|
+ // store ldapAccountInfo to req
|
|
|
|
|
+ req.ldapAccountInfo = ldapAccountInfo;
|
|
|
|
|
+
|
|
|
done(null, ldapAccountInfo);
|
|
done(null, ldapAccountInfo);
|
|
|
}
|
|
}
|
|
|
));
|
|
));
|
|
@@ -212,6 +216,10 @@ class PassportService {
|
|
|
server: serverOpt,
|
|
server: serverOpt,
|
|
|
}, opts);
|
|
}, opts);
|
|
|
debug('ldap configuration: ', mergedOpts);
|
|
debug('ldap configuration: ', mergedOpts);
|
|
|
|
|
+
|
|
|
|
|
+ // store configuration to req
|
|
|
|
|
+ req.ldapConfiguration = mergedOpts;
|
|
|
|
|
+
|
|
|
callback(null, mergedOpts);
|
|
callback(null, mergedOpts);
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|