SubjectX500PrincipalExtractor could use the SAN or dNSName instead of CN

Abierto
#20,059 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Java
Estrellas
9.7k
Forks
6.4k
Merge medio
3 h 22 min
PR fusionados (30 d)
18

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de spring-projects/spring-security

Todos los issues de spring-projects/spring-security

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.