mirror of
https://github.com/minio/minio.git
synced 2026-11-13 14:44:19 +00:00
LDAP config: fix substitution variables (#11586)
- In username search filter and username format variables we support %s for replacing with the username. - In group search filter we support %s for username and %d for the full DN of the username.
This commit is contained in:
1 parent
cec12f4c76
commit
02e7de6367
2 files changed
+9
-2
No files matched your search
@@ -301,7 +301,8 @@ func (l *Config) Bind(username, password string) (string, []string, error) {
|
||||
var groups []string
|
||||
if l.GroupSearchFilter != "" {
|
||||
for _, groupSearchBase := range l.GroupSearchBaseDistNames {
|
||||
filter := strings.Replace(l.GroupSearchFilter, "%s", ldap.EscapeFilter(bindDN), -1)
|
||||
filter := strings.Replace(l.GroupSearchFilter, "%s", ldap.EscapeFilter(username), -1)
|
||||
filter = strings.Replace(filter, "%d", ldap.EscapeFilter(bindDN), -1)
|
||||
searchRequest := ldap.NewSearchRequest(
|
||||
groupSearchBase,
|
||||
ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
|
||||
|
||||
Reference in new issue
Block a user