-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Rancher Server Setup
- Rancher version: v2.6.2
- Installation option (Docker install/Helm Chart): Helm Chart
- If Helm Chart, Kubernetes Cluster and version (RKE1, RKE2, k3s, EKS, etc): RKE2
- Proxy/Cert Details:
Information about the Cluster
- Kubernetes version: v1.21.5+rke2r2
- Cluster Type (Local/Downstream): Local
Describe the bug
When I try to configure the OpenLDAP authentication provider, I get an error: Result Code 32 "No Such Object".
To Reproduce
-
Go to Rancher's OpenLDAP authentication provider configuration page.
-
Fill these following fields:
- Hostname
- Port
- TLS (check)
- Certificate
- Service Account Distinguished Name
- Service Account Password
- User Search Base
-
Use a valid LDAP user for the test.
-
Submit form by clicking on "Enable" button.
Result
Check Rancher logs using the following command:
kubectl -n cattle-system logs -l app=rancher -c rancher --follow
You should see something like this:
2021/10/25 09:51:20 [ERROR] API error response 401 for POST /v3/openLdapConfigs/openldap?action=testAndApply. Cause: LDAP Result Code 32 "No Such Object":
Expected Result
The OpenLDAP authentication should be enabled.
Additional context
By investigating the code and from my understanding, I think the problem comes from the request that is made on lines 71 to 78 in ldap_client.go
. Unfortunately, I don't know how to solve the problem. Do you have an idea?
rancher/pkg/auth/providers/ldap/ldap_client.go
Lines 71 to 78 in 64c748d
searchOpRequest := ldapv2.NewSearchRequest(userDN, | |
ldapv2.ScopeWholeSubtree, ldapv2.NeverDerefAliases, 0, 0, false, | |
fmt.Sprintf("(%v=%v)", ObjectClass, config.UserObjectClass), | |
operationalAttrList, nil) | |
opResult, err := lConn.Search(searchOpRequest) | |
if err != nil { | |
return v3.Principal{}, nil, httperror.WrapAPIError(err, httperror.Unauthorized, "authentication failed") // need to reload this error | |
} |