Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 如何在spring security的x509验证中使用用户名将客户端列入白名单_Spring Boot_Spring Security_X509 - Fatal编程技术网

Spring boot 如何在spring security的x509验证中使用用户名将客户端列入白名单

Spring boot 如何在spring security的x509验证中使用用户名将客户端列入白名单,spring-boot,spring-security,x509,Spring Boot,Spring Security,X509,我有一个Spring Boot应用程序,它使用相互身份验证来验证客户端。这是相互验证配置的对应代码。通过验证客户端证书来保护“/custom”URL @配置 @启用Web安全性 @EnableGlobalMethodSecurity(Prespenabled=true) @Slf4j 公共类MutualAuthConfig扩展了WebSecurity配置适配器{ @凌驾 public void configure(HttpSecurity http)引发异常{ http .csrf().disa

我有一个Spring Boot应用程序,它使用相互身份验证来验证客户端。这是相互验证配置的对应代码。通过验证客户端证书来保护“/custom”URL

@配置
@启用Web安全性
@EnableGlobalMethodSecurity(Prespenabled=true)
@Slf4j
公共类MutualAuthConfig扩展了WebSecurity配置适配器{
@凌驾
public void configure(HttpSecurity http)引发异常{
http
.csrf().disable()
.授权请求()
.antMatchers(“/actuator/**”).permitAll()
.antMatchers(“/custom/**”).authenticated()
.及()
.x509()
.subjectPrincipalRegex(“CN=(.*?(:,|$)”)
.userDetailsService(userDetailsService());
}
@豆子
公共用户详细信息服务用户详细信息服务(){
返回用户名->{
log.info(“客户端证书CN:{}”,用户名);
返回新用户(用户名“”,
权威人士
.commaSeparatedStringToAuthorityList(“角色用户”);
};
}
}
我现在有一个客户端,它将调用相同的“/自定义”URL,需要绕过客户端证书授权。如何实现这一点?是否有规定的方法将特定客户端或用户名列为白名单