Search in sources :

Example 1 with AuthenticationConverter

use of org.springframework.security.web.authentication.AuthenticationConverter in project spring-security by spring-projects.

the class Saml2LoginConfigurerTests method authenticateWhenCustomLoginProcessingUrlAndSaml2AuthenticationTokenConverterBeanThenAuthenticate.

@Test
public void authenticateWhenCustomLoginProcessingUrlAndSaml2AuthenticationTokenConverterBeanThenAuthenticate() throws Exception {
    this.spring.register(CustomLoginProcessingUrlSaml2AuthenticationTokenConverterBean.class).autowire();
    Saml2AuthenticationTokenConverter authenticationConverter = this.spring.getContext().getBean(Saml2AuthenticationTokenConverter.class);
    RelyingPartyRegistration relyingPartyRegistration = TestRelyingPartyRegistrations.noCredentials().assertingPartyDetails((party) -> party.verificationX509Credentials((c) -> c.add(TestSaml2X509Credentials.relyingPartyVerifyingCredential()))).build();
    String response = new String(Saml2Utils.samlDecode(SIGNED_RESPONSE));
    given(authenticationConverter.convert(any(HttpServletRequest.class))).willReturn(new Saml2AuthenticationToken(relyingPartyRegistration, response));
    // @formatter:off
    MockHttpServletRequestBuilder request = post("/my/custom/url").param("SAMLResponse", SIGNED_RESPONSE);
    // @formatter:on
    this.mvc.perform(request).andExpect(redirectedUrl("/"));
    verify(authenticationConverter).convert(any(HttpServletRequest.class));
}
Also used : RelyingPartyRegistration(org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration) Saml2AuthenticationRequestRepository(org.springframework.security.saml2.provider.service.web.Saml2AuthenticationRequestRepository) BeforeEach(org.junit.jupiter.api.BeforeEach) UriComponentsBuilder(org.springframework.web.util.UriComponentsBuilder) URLDecoder(java.net.URLDecoder) FilterChainProxy(org.springframework.security.web.FilterChainProxy) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Saml2AuthenticationRequestResolver(org.springframework.security.saml2.provider.service.web.authentication.Saml2AuthenticationRequestResolver) AuthnRequest(org.opensaml.saml.saml2.core.AuthnRequest) Autowired(org.springframework.beans.factory.annotation.Autowired) AuthenticationProvider(org.springframework.security.authentication.AuthenticationProvider) ObjectPostProcessor(org.springframework.security.config.annotation.ObjectPostProcessor) HttpSecurity(org.springframework.security.config.annotation.web.builders.HttpSecurity) HttpSessionSecurityContextRepository(org.springframework.security.web.context.HttpSessionSecurityContextRepository) ServletException(jakarta.servlet.ServletException) RelyingPartyRegistration(org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration) MockHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) WebSecurityConfigurerAdapter(org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) BDDMockito.given(org.mockito.BDDMockito.given) Duration(java.time.Duration) ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) Saml2AuthenticationRequestContext(org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationRequestContext) OpenSamlAuthenticationProvider(org.springframework.security.saml2.provider.service.authentication.OpenSamlAuthenticationProvider) AuthenticationException(org.springframework.security.core.AuthenticationException) DefaultRelyingPartyRegistrationResolver(org.springframework.security.saml2.provider.service.web.DefaultRelyingPartyRegistrationResolver) OpenSaml4AuthenticationRequestResolver(org.springframework.security.saml2.provider.service.web.authentication.OpenSaml4AuthenticationRequestResolver) Saml2Authentication(org.springframework.security.saml2.provider.service.authentication.Saml2Authentication) Collection(java.util.Collection) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) MockMvcResultMatchers.redirectedUrl(org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl) Instant(java.time.Instant) GrantedAuthority(org.springframework.security.core.GrantedAuthority) Test(org.junit.jupiter.api.Test) Base64(java.util.Base64) Saml2AuthenticationException(org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationException) TestSaml2AuthenticationRequestContexts(org.springframework.security.saml2.provider.service.authentication.TestSaml2AuthenticationRequestContexts) Authentication(org.springframework.security.core.Authentication) Mockito.mock(org.mockito.Mockito.mock) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) HttpServletRequest(jakarta.servlet.http.HttpServletRequest) MockFilterChain(org.springframework.mock.web.MockFilterChain) HttpRequestResponseHolder(org.springframework.security.web.context.HttpRequestResponseHolder) RelyingPartyRegistrationRepository(org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistrationRepository) SimpleGrantedAuthority(org.springframework.security.core.authority.SimpleGrantedAuthority) OpenSaml4AuthenticationProvider(org.springframework.security.saml2.provider.service.authentication.OpenSaml4AuthenticationProvider) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) TestOpenSamlObjects(org.springframework.security.saml2.provider.service.authentication.TestOpenSamlObjects) MockMvc(org.springframework.test.web.servlet.MockMvc) ArgumentCaptor(org.mockito.ArgumentCaptor) Saml2AuthenticationRequestContextResolver(org.springframework.security.saml2.provider.service.web.Saml2AuthenticationRequestContextResolver) MockMvcResultMatchers.status(org.springframework.test.web.servlet.result.MockMvcResultMatchers.status) BeanCreationException(org.springframework.beans.factory.BeanCreationException) MockMvcRequestBuilders.post(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post) AbstractSaml2AuthenticationRequest(org.springframework.security.saml2.provider.service.authentication.AbstractSaml2AuthenticationRequest) MvcResult(org.springframework.test.web.servlet.MvcResult) Assertion(org.opensaml.saml.saml2.core.Assertion) OpenSaml4AuthenticationRequestFactory(org.springframework.security.saml2.provider.service.authentication.OpenSaml4AuthenticationRequestFactory) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) Converter(org.springframework.core.convert.converter.Converter) Saml2ErrorCodes(org.springframework.security.saml2.core.Saml2ErrorCodes) Saml2WebSsoAuthenticationFilter(org.springframework.security.saml2.provider.service.servlet.filter.Saml2WebSsoAuthenticationFilter) Saml2AuthenticationRequestFactory(org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationRequestFactory) Saml2AuthenticationToken(org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationToken) AuthenticationManager(org.springframework.security.authentication.AuthenticationManager) RelyingPartyRegistrationResolver(org.springframework.security.saml2.provider.service.web.RelyingPartyRegistrationResolver) AuthenticationServiceException(org.springframework.security.authentication.AuthenticationServiceException) Saml2Utils(org.springframework.security.saml2.core.Saml2Utils) Customizer(org.springframework.security.config.Customizer) Import(org.springframework.context.annotation.Import) ProviderManager(org.springframework.security.authentication.ProviderManager) Saml2AuthenticationTokenConverter(org.springframework.security.saml2.provider.service.web.Saml2AuthenticationTokenConverter) ReflectionTestUtils(org.springframework.test.util.ReflectionTestUtils) IOException(java.io.IOException) TestSaml2X509Credentials(org.springframework.security.saml2.core.TestSaml2X509Credentials) SecurityFilterChain(org.springframework.security.web.SecurityFilterChain) Mockito.verify(org.mockito.Mockito.verify) AfterEach(org.junit.jupiter.api.AfterEach) GrantedAuthoritiesMapper(org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper) EnableWebSecurity(org.springframework.security.config.annotation.web.configuration.EnableWebSecurity) SpringTestContext(org.springframework.security.config.test.SpringTestContext) Assertions(org.junit.jupiter.api.Assertions) AuthenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter) MockMvcRequestBuilders.get(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get) SpringTestContextExtension(org.springframework.security.config.test.SpringTestContextExtension) AuthenticationFailureHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler) SecurityContextRepository(org.springframework.security.web.context.SecurityContextRepository) HttpServletResponse(jakarta.servlet.http.HttpServletResponse) Bean(org.springframework.context.annotation.Bean) Customizer.withDefaults(org.springframework.security.config.Customizer.withDefaults) Collections(java.util.Collections) TestRelyingPartyRegistrations(org.springframework.security.saml2.provider.service.registration.TestRelyingPartyRegistrations) UriComponents(org.springframework.web.util.UriComponents) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) HttpServletRequest(jakarta.servlet.http.HttpServletRequest) Saml2AuthenticationTokenConverter(org.springframework.security.saml2.provider.service.web.Saml2AuthenticationTokenConverter) MockHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Saml2AuthenticationToken(org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationToken) Test(org.junit.jupiter.api.Test)

Example 2 with AuthenticationConverter

use of org.springframework.security.web.authentication.AuthenticationConverter in project spring-security by spring-projects.

the class Saml2WebSsoAuthenticationFilterTests method setAuthenticationRequestRepositoryWhenNotExpectedAuthenticationConverterTypeThenDoNotSet.

@Test
public void setAuthenticationRequestRepositoryWhenNotExpectedAuthenticationConverterTypeThenDoNotSet() {
    AuthenticationConverter authenticationConverter = mock(AuthenticationConverter.class);
    Saml2AuthenticationRequestRepository<AbstractSaml2AuthenticationRequest> authenticationRequestRepository = mock(Saml2AuthenticationRequestRepository.class);
    this.filter = new Saml2WebSsoAuthenticationFilter(authenticationConverter, "/some/other/path/{registrationId}");
    this.filter.setAuthenticationRequestRepository(authenticationRequestRepository);
    verifyNoInteractions(authenticationConverter);
}
Also used : AuthenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter) AbstractSaml2AuthenticationRequest(org.springframework.security.saml2.provider.service.authentication.AbstractSaml2AuthenticationRequest) Test(org.junit.jupiter.api.Test)

Example 3 with AuthenticationConverter

use of org.springframework.security.web.authentication.AuthenticationConverter in project spring-security by spring-projects.

the class Saml2LoginConfigurerTests method authenticateWhenCustomAuthenticationConverterBeanThenUses.

@Test
public void authenticateWhenCustomAuthenticationConverterBeanThenUses() throws Exception {
    this.spring.register(CustomAuthenticationConverterBean.class).autowire();
    Saml2AuthenticationTokenConverter authenticationConverter = this.spring.getContext().getBean(Saml2AuthenticationTokenConverter.class);
    RelyingPartyRegistration relyingPartyRegistration = TestRelyingPartyRegistrations.noCredentials().assertingPartyDetails((party) -> party.verificationX509Credentials((c) -> c.add(TestSaml2X509Credentials.relyingPartyVerifyingCredential()))).build();
    String response = new String(Saml2Utils.samlDecode(SIGNED_RESPONSE));
    given(authenticationConverter.convert(any(HttpServletRequest.class))).willReturn(new Saml2AuthenticationToken(relyingPartyRegistration, response));
    // @formatter:off
    MockHttpServletRequestBuilder request = post("/login/saml2/sso/" + relyingPartyRegistration.getRegistrationId()).param("SAMLResponse", SIGNED_RESPONSE);
    // @formatter:on
    this.mvc.perform(request).andExpect(redirectedUrl("/"));
    verify(authenticationConverter).convert(any(HttpServletRequest.class));
}
Also used : RelyingPartyRegistration(org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration) Saml2AuthenticationRequestRepository(org.springframework.security.saml2.provider.service.web.Saml2AuthenticationRequestRepository) BeforeEach(org.junit.jupiter.api.BeforeEach) UriComponentsBuilder(org.springframework.web.util.UriComponentsBuilder) URLDecoder(java.net.URLDecoder) FilterChainProxy(org.springframework.security.web.FilterChainProxy) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Saml2AuthenticationRequestResolver(org.springframework.security.saml2.provider.service.web.authentication.Saml2AuthenticationRequestResolver) AuthnRequest(org.opensaml.saml.saml2.core.AuthnRequest) Autowired(org.springframework.beans.factory.annotation.Autowired) AuthenticationProvider(org.springframework.security.authentication.AuthenticationProvider) ObjectPostProcessor(org.springframework.security.config.annotation.ObjectPostProcessor) HttpSecurity(org.springframework.security.config.annotation.web.builders.HttpSecurity) HttpSessionSecurityContextRepository(org.springframework.security.web.context.HttpSessionSecurityContextRepository) ServletException(jakarta.servlet.ServletException) RelyingPartyRegistration(org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration) MockHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) WebSecurityConfigurerAdapter(org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) BDDMockito.given(org.mockito.BDDMockito.given) Duration(java.time.Duration) ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) Saml2AuthenticationRequestContext(org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationRequestContext) OpenSamlAuthenticationProvider(org.springframework.security.saml2.provider.service.authentication.OpenSamlAuthenticationProvider) AuthenticationException(org.springframework.security.core.AuthenticationException) DefaultRelyingPartyRegistrationResolver(org.springframework.security.saml2.provider.service.web.DefaultRelyingPartyRegistrationResolver) OpenSaml4AuthenticationRequestResolver(org.springframework.security.saml2.provider.service.web.authentication.OpenSaml4AuthenticationRequestResolver) Saml2Authentication(org.springframework.security.saml2.provider.service.authentication.Saml2Authentication) Collection(java.util.Collection) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) MockMvcResultMatchers.redirectedUrl(org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl) Instant(java.time.Instant) GrantedAuthority(org.springframework.security.core.GrantedAuthority) Test(org.junit.jupiter.api.Test) Base64(java.util.Base64) Saml2AuthenticationException(org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationException) TestSaml2AuthenticationRequestContexts(org.springframework.security.saml2.provider.service.authentication.TestSaml2AuthenticationRequestContexts) Authentication(org.springframework.security.core.Authentication) Mockito.mock(org.mockito.Mockito.mock) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) HttpServletRequest(jakarta.servlet.http.HttpServletRequest) MockFilterChain(org.springframework.mock.web.MockFilterChain) HttpRequestResponseHolder(org.springframework.security.web.context.HttpRequestResponseHolder) RelyingPartyRegistrationRepository(org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistrationRepository) SimpleGrantedAuthority(org.springframework.security.core.authority.SimpleGrantedAuthority) OpenSaml4AuthenticationProvider(org.springframework.security.saml2.provider.service.authentication.OpenSaml4AuthenticationProvider) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) TestOpenSamlObjects(org.springframework.security.saml2.provider.service.authentication.TestOpenSamlObjects) MockMvc(org.springframework.test.web.servlet.MockMvc) ArgumentCaptor(org.mockito.ArgumentCaptor) Saml2AuthenticationRequestContextResolver(org.springframework.security.saml2.provider.service.web.Saml2AuthenticationRequestContextResolver) MockMvcResultMatchers.status(org.springframework.test.web.servlet.result.MockMvcResultMatchers.status) BeanCreationException(org.springframework.beans.factory.BeanCreationException) MockMvcRequestBuilders.post(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post) AbstractSaml2AuthenticationRequest(org.springframework.security.saml2.provider.service.authentication.AbstractSaml2AuthenticationRequest) MvcResult(org.springframework.test.web.servlet.MvcResult) Assertion(org.opensaml.saml.saml2.core.Assertion) OpenSaml4AuthenticationRequestFactory(org.springframework.security.saml2.provider.service.authentication.OpenSaml4AuthenticationRequestFactory) Assertions.assertThatExceptionOfType(org.assertj.core.api.Assertions.assertThatExceptionOfType) Converter(org.springframework.core.convert.converter.Converter) Saml2ErrorCodes(org.springframework.security.saml2.core.Saml2ErrorCodes) Saml2WebSsoAuthenticationFilter(org.springframework.security.saml2.provider.service.servlet.filter.Saml2WebSsoAuthenticationFilter) Saml2AuthenticationRequestFactory(org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationRequestFactory) Saml2AuthenticationToken(org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationToken) AuthenticationManager(org.springframework.security.authentication.AuthenticationManager) RelyingPartyRegistrationResolver(org.springframework.security.saml2.provider.service.web.RelyingPartyRegistrationResolver) AuthenticationServiceException(org.springframework.security.authentication.AuthenticationServiceException) Saml2Utils(org.springframework.security.saml2.core.Saml2Utils) Customizer(org.springframework.security.config.Customizer) Import(org.springframework.context.annotation.Import) ProviderManager(org.springframework.security.authentication.ProviderManager) Saml2AuthenticationTokenConverter(org.springframework.security.saml2.provider.service.web.Saml2AuthenticationTokenConverter) ReflectionTestUtils(org.springframework.test.util.ReflectionTestUtils) IOException(java.io.IOException) TestSaml2X509Credentials(org.springframework.security.saml2.core.TestSaml2X509Credentials) SecurityFilterChain(org.springframework.security.web.SecurityFilterChain) Mockito.verify(org.mockito.Mockito.verify) AfterEach(org.junit.jupiter.api.AfterEach) GrantedAuthoritiesMapper(org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper) EnableWebSecurity(org.springframework.security.config.annotation.web.configuration.EnableWebSecurity) SpringTestContext(org.springframework.security.config.test.SpringTestContext) Assertions(org.junit.jupiter.api.Assertions) AuthenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter) MockMvcRequestBuilders.get(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get) SpringTestContextExtension(org.springframework.security.config.test.SpringTestContextExtension) AuthenticationFailureHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler) SecurityContextRepository(org.springframework.security.web.context.SecurityContextRepository) HttpServletResponse(jakarta.servlet.http.HttpServletResponse) Bean(org.springframework.context.annotation.Bean) Customizer.withDefaults(org.springframework.security.config.Customizer.withDefaults) Collections(java.util.Collections) TestRelyingPartyRegistrations(org.springframework.security.saml2.provider.service.registration.TestRelyingPartyRegistrations) UriComponents(org.springframework.web.util.UriComponents) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) HttpServletRequest(jakarta.servlet.http.HttpServletRequest) Saml2AuthenticationTokenConverter(org.springframework.security.saml2.provider.service.web.Saml2AuthenticationTokenConverter) MockHttpServletRequestBuilder(org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Saml2AuthenticationToken(org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationToken) Test(org.junit.jupiter.api.Test)

Example 4 with AuthenticationConverter

use of org.springframework.security.web.authentication.AuthenticationConverter in project spring-security by spring-projects.

the class Saml2WebSsoAuthenticationFilterTests method constructingFilterWithMissingRegistrationIdVariableAndCustomAuthenticationConverterThenSucceeds.

@Test
public void constructingFilterWithMissingRegistrationIdVariableAndCustomAuthenticationConverterThenSucceeds() {
    AuthenticationConverter authenticationConverter = mock(AuthenticationConverter.class);
    this.filter = new Saml2WebSsoAuthenticationFilter(authenticationConverter, "/url/missing/variable");
}
Also used : AuthenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter) Test(org.junit.jupiter.api.Test)

Example 5 with AuthenticationConverter

use of org.springframework.security.web.authentication.AuthenticationConverter in project spring-security by spring-projects.

the class Saml2WebSsoAuthenticationFilterTests method attemptAuthenticationWhenSavedAuthnRequestThenRemovesAuthnRequest.

@Test
public void attemptAuthenticationWhenSavedAuthnRequestThenRemovesAuthnRequest() {
    Saml2AuthenticationRequestRepository<AbstractSaml2AuthenticationRequest> authenticationRequestRepository = mock(Saml2AuthenticationRequestRepository.class);
    AuthenticationConverter authenticationConverter = mock(AuthenticationConverter.class);
    given(authenticationConverter.convert(this.request)).willReturn(TestSaml2AuthenticationTokens.token());
    this.filter = new Saml2WebSsoAuthenticationFilter(authenticationConverter, "/some/other/path/{registrationId}");
    this.filter.setAuthenticationManager((authentication) -> null);
    this.request.setPathInfo("/some/other/path/idp-registration-id");
    this.filter.setAuthenticationRequestRepository(authenticationRequestRepository);
    this.filter.attemptAuthentication(this.request, this.response);
    verify(authenticationRequestRepository).removeAuthenticationRequest(this.request, this.response);
}
Also used : AuthenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter) AbstractSaml2AuthenticationRequest(org.springframework.security.saml2.provider.service.authentication.AbstractSaml2AuthenticationRequest) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)8 AuthenticationConverter (org.springframework.security.web.authentication.AuthenticationConverter)8 AbstractSaml2AuthenticationRequest (org.springframework.security.saml2.provider.service.authentication.AbstractSaml2AuthenticationRequest)5 HttpServletResponse (jakarta.servlet.http.HttpServletResponse)3 Assertions.assertThatExceptionOfType (org.assertj.core.api.Assertions.assertThatExceptionOfType)3 Assertions (org.junit.jupiter.api.Assertions)3 BeforeEach (org.junit.jupiter.api.BeforeEach)3 BDDMockito.given (org.mockito.BDDMockito.given)3 Mockito.mock (org.mockito.Mockito.mock)3 Mockito.verify (org.mockito.Mockito.verify)3 Mockito.verifyNoInteractions (org.mockito.Mockito.verifyNoInteractions)3 MockFilterChain (org.springframework.mock.web.MockFilterChain)3 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)3 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)3 AuthenticationDetailsSource (org.springframework.security.authentication.AuthenticationDetailsSource)3 AuthenticationManager (org.springframework.security.authentication.AuthenticationManager)3 Authentication (org.springframework.security.core.Authentication)3 Saml2AuthenticationToken (org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationToken)3 ServletException (jakarta.servlet.ServletException)2 HttpServletRequest (jakarta.servlet.http.HttpServletRequest)2