kubesphere / kubesphere/website

LDAP : it can’t work when uid contains special characters

Open
#2,397 3 comments 0 reactions 0 assignees View on GitHub
help wanted
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?

![image](https://user-images.githubusercontent.com/22019924/163976204-6b5fcaa7-4b78-4092-88d4-9f9e500352e7.png)

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.