use of org.springframework.security.web.authentication.preauth.x509.X509PrincipalExtractor in project spring-security by spring-projects.
the class ServerHttpSecurityTests method addsX509FilterWhenX509AuthenticationIsConfigured.
@Test
@SuppressWarnings("unchecked")
public void addsX509FilterWhenX509AuthenticationIsConfigured() {
X509PrincipalExtractor mockExtractor = mock(X509PrincipalExtractor.class);
ReactiveAuthenticationManager mockAuthenticationManager = mock(ReactiveAuthenticationManager.class);
this.http.x509().principalExtractor(mockExtractor).authenticationManager(mockAuthenticationManager).and();
SecurityWebFilterChain securityWebFilterChain = this.http.build();
WebFilter x509WebFilter = securityWebFilterChain.getWebFilters().filter(this::isX509Filter).blockFirst();
assertThat(x509WebFilter).isNotNull();
}
use of org.springframework.security.web.authentication.preauth.x509.X509PrincipalExtractor in project spring-security by spring-projects.
the class ServerHttpSecurityTests method x509WhenCustomizedThenAddsX509Filter.
@Test
public void x509WhenCustomizedThenAddsX509Filter() {
X509PrincipalExtractor mockExtractor = mock(X509PrincipalExtractor.class);
ReactiveAuthenticationManager mockAuthenticationManager = mock(ReactiveAuthenticationManager.class);
this.http.x509((x509) -> x509.principalExtractor(mockExtractor).authenticationManager(mockAuthenticationManager));
SecurityWebFilterChain securityWebFilterChain = this.http.build();
WebFilter x509WebFilter = securityWebFilterChain.getWebFilters().filter(this::isX509Filter).blockFirst();
assertThat(x509WebFilter).isNotNull();
}
Aggregations