Hi there!
Looking at the documentation of passport-ldapauth you are using, it looks like the parameter server.searchAttributes is an array. I haven't managed to set those search attributes the way I want. Setting it in docker-compose.yml didn't work:
- environment:
- HMD_LDAP_SEARCHATTRIBUTES=['uid', 'mail']
Then I tried to specify it in the config.json like this:
"ldap": {
"searchAttributes": ["uid,", "mail"],
// ...
}
But again, this did not work.
By "does not work" I mean, that some garbage is given to the searchAttributes of passport-ldapauth such that actually none of the fields I specified (uid and mail) were returned by the ldap query.
Am I doing something wrong? Has someone ever tested using the SEARCHATTRIBUTES setting? Or is it indeed not possible to pass an array via json or env variables?
So you found one bug for sure, the fact that you can't specify any array right now as environment variables because when I don't get the code completely wrong this would be returned as string and this way never become an array. There is some code needed to decode it.
For your config.json example, I'm not really sure. In theory it works, in practice, I never tried it myself.
Maybe some of the LDAP feature baker and users can say something about it.
/cc @alecdwm @neopostmodern
Hey @LukasKalbertodt, sorry for the troubles!
I somehow managed to overlook the fact that passport-ldapauth takes an array for searchAttributes back in the initial implementation. Thanks for bringing it up!
First up, your config example should _nearly_ have worked, but instead of this:
"ldap": {
"searchAttributes": ["uid,", "mail"],
// ...
}
Try doing this:
"ldap": {
"searchAttributes": ["uid", "mail"],
// ...
}
As for the environment variable HMD_LDAP_SEARCHATTRIBUTES, I'm putting together a quick pull request to get that fixed. I'll reference this issue so you can check it out!
@alecdwm you rock! thanks a lot for this support work!
Fixed by #651
Most helpful comment
Hey @LukasKalbertodt, sorry for the troubles!
I somehow managed to overlook the fact that
passport-ldapauthtakes an array forsearchAttributesback in the initial implementation. Thanks for bringing it up!First up, your config example should _nearly_ have worked, but instead of this:
Try doing this:
As for the environment variable
HMD_LDAP_SEARCHATTRIBUTES, I'm putting together a quick pull request to get that fixed. I'll reference this issue so you can check it out!