fix: pass proper username (simple) string as expected (#16555)

This commit is contained in:
Harshavardhana
2023-02-07 03:43:08 -08:00
committed by GitHub
parent 11c7ecb5cf
commit 0319ae756a
4 changed files with 111 additions and 16 deletions

View File

@@ -199,15 +199,8 @@ func getConditionValues(r *http.Request, lc string, cred auth.Credentials) map[s
for k, v := range claims {
vStr, ok := v.(string)
if ok {
// Special case for AD/LDAP STS users
switch k {
case ldapUser:
args["user"] = []string{vStr}
case ldapUserN:
args["username"] = []string{vStr}
default:
args[k] = []string{vStr}
}
// Trim any LDAP specific prefix
args[strings.ToLower(strings.TrimPrefix(k, "ldap"))] = []string{vStr}
}
}