LDAP settings should be verified before saving -> locked out due to misconfiguration
I tried to configure LDAP using the webinterface. As no option is available to test/verify the entered LDAP settings before saving them, an error leads to a lockout out of the system. Even the former "local non-ldap" firstly created admin user doesn't seem to work anymore now.
I totally agree. In LDAP settings page, there should be a button to confirm if ldap settings are successful.
Currently,
- you fill the fields in the ldap settings form
- press save settings button
- logout from the current user account
- try to login with ldap credentials
- if doesn't work, connect to mongo to turn off LDAP_Enable flag in the database
- login with non-ldap user account and go to ldap settings page to change settings and repeat all over
This is very time consuming, especially if you can't get it done in few turns...
We are going to do a wrapper on the LDAP function so the LoginWithLDAP will use regular login as a fallback by default. You'll be able to turn that off if you want.
Btw, you can always open an anonymous browser window to test the LDAP login before you disconnect from admin... ;) just a tip.
We are going to do a wrapper on the LDAP function so the LoginWithLDAP will use regular login as a fallback by default.
That would be great.
you can always open an anonymous browser window to test the LDAP login before you disconnect from admin
Opened a new chrome tab to login as ldap user. However, new window opens as the original user logged in. Logging out in the new window causes logging out in the original tab/window too. But you're right perhaps I should have tried to open a new window in another browser like firefox instead of going through all that stress :-)
It's possible, but you should better now that BEFORE editing your settings ;-)
We can add a button to test the saved settings.
This PR https://github.com/RocketChat/Rocket.Chat/pull/1957 will add fallback to default login system, so you can login back to rocket.chat if LDAP didn't work.
IMHO this is not the right approach. There should ALWAYS be a way to log in to the server for Admin, regardless of tle LDAP setting, so that one cannot log himself out in case of misconfiguration. Perhaps one local account that is always functional?