Skip to content

Commit

Permalink
auth-provider: Fix LDAP login filter
Browse files Browse the repository at this point in the history
Using a substring filter is certainly wrong here. We need an exact match.
  • Loading branch information
rhafer committed Apr 13, 2022
1 parent 120c059 commit 9fb4ccd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/auth/manager/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (am *mgr) Authenticate(ctx context.Context, clientID, clientSecret string)
func (am *mgr) getLoginFilter(login string) string {
var filter string
for _, attr := range am.c.LoginAttributes {
filter = fmt.Sprintf("%s(%s=%s*)", filter, attr, ldap.EscapeFilter(login))
filter = fmt.Sprintf("%s(%s=%s)", filter, attr, ldap.EscapeFilter(login))
}

return fmt.Sprintf("(&%s(objectclass=%s)(|%s))",
Expand Down

0 comments on commit 9fb4ccd

Please sign in to comment.