Commit a7097c80 authored by rithu leena john's avatar rithu leena john Committed by GitHub

Merge pull request #933 from rithujohn191/ldap-fix

connector/ldap: check for blank passwords and return error.
parents 81d24f18 6e3e1741
...@@ -359,6 +359,11 @@ func (c *ldapConnector) userEntry(conn *ldap.Conn, username string) (user ldap.E ...@@ -359,6 +359,11 @@ func (c *ldapConnector) userEntry(conn *ldap.Conn, username string) (user ldap.E
} }
func (c *ldapConnector) Login(ctx context.Context, s connector.Scopes, username, password string) (ident connector.Identity, validPass bool, err error) { func (c *ldapConnector) Login(ctx context.Context, s connector.Scopes, username, password string) (ident connector.Identity, validPass bool, err error) {
// make this check to avoid anonymous bind to the LDAP server.
if password == "" {
return connector.Identity{}, false, nil
}
var ( var (
// We want to return a different error if the user's password is incorrect vs // We want to return a different error if the user's password is incorrect vs
// if there was an error. // if there was an error.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment