SubjectX500PrincipalExtractor could use the SAN or dNSName instead of CN

Đang mở
#20,059 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
authentication, security

Hướng nghiên cứu

Start by reading the X.509 configuration and SubjectX500PrincipalExtractor implementation, then trace how the principal is derived from a certificate. Compare the current CN behavior with the suggested distinguished-name and SAN options, and check the related X.509 tests. Done means the principal extraction behavior and its tests address the requested SAN or dNSName support.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

status: waiting-for-triage type: enhancement
@Bean
SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) {
	return httpSecurity
		.x509(Customizer.withDefaults())
		.csrf(customizer -> customizer.disable())
		.build();
}

results in using SubjectX500PrincipalExtractor which creates the Principal based on CN property of the certificate.

Rfc2818 "Although the use of the Common Name is existing practice, it is deprecated and Certification Authorities are encouraged to use the dNSName instead, https://www.rfc-editor.org/info/rfc2818/

Alternative:

@Bean
SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) {
        return httpSecurity
                .x509(customizer -> customizer.x509PrincipalExtractor(cert -> {
                    return cert.getSubjectX500Principal().getName();
                }))
                .csrf(x -> x.disable())
                .build();
}

It uses the distinguished name. SAN could also be used.

Ngôn ngữ chính
Java
Star
9.7k
Fork
6.4k
Merge trung bình
7 ngày 12 giờ
Pull request đã merge (30 ngày)
35

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của spring-projects/spring-security

Tất cả issue của spring-projects/spring-security

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.