nginx-ldap
nginx-ldap copied to clipboard
Prevent error when wrong username was provided
When a wrong password was provided check_auth returns with false. But when a wrong username was provided there is an unhandled error:
...
ldap_connection.simple_bind_s(data['distinguishedName'][0], passwd)
TypeError: list indices must be integers, not str
Because of this the proxy replies with 500 error and nginx doesn't prompt for account details again. This can be prevented by checking that distinguishedName is present in data.