Skip to content
Snippets Groups Projects
Commit 4413a4ac authored by Guillaume WANG's avatar Guillaume WANG
Browse files

fixed ldap config import in config_passport

parent 2cebf504
No related branches found
No related tags found
No related merge requests found
......@@ -241,7 +241,8 @@ router.use((req, res, next) => {
*/
router.use((err, req, res, next) => {
console.log("adminview: Entering error handler");
console.log(err.message);
console.log(err);
//console.log(err.message);
//res.status(err.status || 500);
res.render('error', {
......
......@@ -208,8 +208,19 @@ const context = async ({ req }): Promise<Context> => {
console.log(err);
}
}
return {
console.log(`Constructing context with uid = ${uid}`);
/*return {
request: req,
user: { uid: uid },
models: {
auth: await AuthorizationModel.create(uid),
user: new UserModel(uid),
group: new GroupModel(uid),
message: new MessageModel(uid),
request: new RequestModel(uid)
}
};*/
let blah = {
request: req,
user: { uid: uid },
models: {
......@@ -220,6 +231,8 @@ const context = async ({ req }): Promise<Context> => {
request: new RequestModel(uid)
}
};
console.log("finished constructing context");
return blah;
};
const server = new ApolloServer({
......
......@@ -40,10 +40,11 @@ passport.use(new LdapStrategy({
url: ldapConfig.server,
//bindDn: '.............',
//bindCredentials: '..........',
// searchBase: ldapConfig.searchBase, TODO: this cannot be left empty.
// searchFilter: ldapConfig.searchFilter, TODO: this cannot be left empty.
//searchAttributes: ['givenName', 'sn'],
searchBase: ldapConfig.dn_users, // 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
},
//usernameField: 'username', // Field name where the username is found, defaults to username
//passwordField: 'password', // Field name where the password is found, defaults to password
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment