Skip to content

Commit

Permalink
Merge pull request #7 from rithujohn191/ldap-password-check
Browse files Browse the repository at this point in the history
connector/ldap: check for blank passwords and return error.
  • Loading branch information
rithujohn191 authored May 2, 2017
2 parents 65318da + 58eee98 commit 1025372
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 1025372

Please sign in to comment.