-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update LDAP Settings page to make it clearer for users - Also mask BIND Password from view and logs. #737
Comments
This would be great. Last time I checked, the LDAP settings only allowed for anonymous binds, is that still true? Also, are logins only allowed with LDAP accounts once LDAP is enabled? If you mess up your LDAP config, how do you recover? |
@mottersen you can login via browser's console: |
This is not annon bind any more it uses a proxyuser account, grabs the user's dn and then autheniticates with the UI user. Tested on a couple of AD LDAP and Group filter. |
Thanks for the info guys, didn't mean to hijack. I like the suggestions @Megatronic79 |
I'm still looking for the area where I can input my bind id information. I can't add my LDAP until I find some variation of these fields. Bind UserDN: (User with search permissions on LDAP \ AD) |
Assumptions: So Domain = domain.com For now (until we add more input fields to LDAP) set it like this: (This is based on the above assumptions, replace with your environment) LDAP_Enable = True |
Thanks @Megatronic79. After a little fiddling around, those instructions worked for me. This should be clear due to the context, but in the case of [email protected]: domain.com would be the FQDN for your domain. For some people their FQDN is different from their email domain e.g. corp.domain.com. I'm also used to defining the bind ID with it's DN, not the user Principal Name (user@FQDN), but perhaps that's because I use AD, not LDAP. I have two other minor requests related to LDAP.
I hope those requests are more or less clear, and thanks again. |
Glad you got it working. In the case of [email protected] (which is the userPrincipalName - which is also fine in AD windows) but if its easier it can be substituited with the DN of said proxy user: In this example: Making the filter {"filter": "(&(objectCategory=person)(objectclass=user)(memberOf=CN=ROCKET_USER,CN=Users,DC=domain,DC=com)(sAMAccountName=#{username}))", "scope": "sub", "userDN": "CN=rocket chat,CN=Users,DC=domain,DC=com", "password": "urpass"} with Question 1: If you want to use a different attribute to login then you can edit the filter again: such that username = sAMAccountName Example (To logon with mail attribute = email) {"filter": "(&(objectCategory=person)(objectclass=user)(memberOf=CN=ROCKET_USER,CN=Users,DC=domain,DC=com)(mail=#{username}))", "scope": "sub", "userDN": "CN=rocket chat,CN=Users,DC=domain,DC=com", "password": "urpass"} With Question 2 Agree it would ne nice to populate the users profile based on AD and to be able to search on any criteria. I'll amend the Wiki with the DN instead of userPrincipalName to make it easier and add the comment for logon attribute. |
Reread your question 1 - if you want it to either sign in with email or username then use the filter example like this {"filter": "(&(objectCategory=person)(objectclass=user)(memberOf=CN=ROCKET_ACCESS,CN=Users,DC=domain,DC=com)(|(mail=#{username})(sAMAccountName=#{username})))", "scope": "sub", "userDN": "CN=rocket chat,CN=Users,DC=domain,DC=com", "password": "urpass"} This is saying check to see if user is in ROCKET_ACCESS Group and UI logon = mail or sAMAccountName. That should sort your out for now. |
We should update the Settings page to capture this information to make it clearer for users:
LDAP Settings Page:
BaseDN: (Root of the domain)
Bind UserDN: (User with search permissions on LDAP \ AD)
Bind UserPW: (Users password)
LDAP port: (LDAP Port - if not set default to 389)
Ldap URL: (ldap://ldapservername)
Ldap Group Filter: (LDAP query in the form (&(objectCategory=person)(objectclass=user)(memberOf=CN=ROCKET_GROUP,CN=Groups,DC=domain,DC=com)
Logon Attribute: (Example mail or sAMAccountNAME)
Ldap Enable: (True false)
Then LDAP Filter is passed in the background as
{"filter": "Ldap Group Filter" (Logon Attribute=#{username})), "scope": "sub", "userDN": "Bind UserDN", "password": "Bind UserPW"}
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: