Skip to content

Commit

Permalink
auth-provider: Fix LDAP login filter (#2742)
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 19, 2022
1 parent d46af8c commit 692b55d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions changelog/unreleased/ldap-login-filter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Use exact match in login filter

After the recent config changes the auth-provider was accidently using a
substring match for the login filter. It's no fixed to use an exact match.

https://github.com/cs3org/reva/pull/2742
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 692b55d

Please sign in to comment.