kubesphere / kubesphere/website
LDAP : it can’t work when uid contains special characters
- Dominant language
- SCSS
- Stars
- 97
- Forks
- 418
- PR merge metrics
- No merged PRs in 30d
Description
I login in with LDAP, i can not conform successfully when the **uid** contains special characters. such as it is email Format ,
and In case I cannot modify LDAP related information , are there any other options?

log:
```
E0419 17:08:16.396571 1 im.go:153] User.iam.kubesphere.io "xiaohua.zhu" is invalid: metadata.labels: Invalid value: "xiaohua.zhu@test.com": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')
E0419 17:08:16.396774 1 utils.go:76] /workspace/pkg/kapis/iam/v1alpha2/handler.go:527 User.iam.kubesphere.io "xiaohua.zhu" is invalid: metadata.labels: Invalid value: "xiaohua.zhu@test.com": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')
I0419 17:08:16.396939 1 apiserver.go:599] undefined - "POST /kapis/iam.kubesphere.io/v1alpha2/users HTTP/1.1" 422 382 9ms
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the LDAP login request through pkg/kapis/iam/v1alpha2/handler.go around the reported line 527, then inspect im.go:153 and utils.go:76 alongside the validation log. Reproduce the email-format uid case and determine the supported behavior; done requires the login path to handle the reported uid or clearly document an alternative.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100