Skip to content

Commit

Permalink
connector/ldap: check for blank passwords and return error.
Browse files Browse the repository at this point in the history
  • Loading branch information
rithujohn191 committed May 1, 2017
1 parent 9b0af83 commit 58eee98
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions connector/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,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) {
// make this check to avoid anonymous bind to the LDAP server.
if password == "" {
return connector.Identity{}, false, nil
}

var (
// We want to return a different error if the user's password is incorrect vs
// if there was an error.
Expand Down

0 comments on commit 58eee98

Please sign in to comment.