Search in sources :

Example 1 with WebBasedPluginAuthenticationProvider

use of com.thoughtworks.go.server.newsecurity.providers.WebBasedPluginAuthenticationProvider in project gocd by gocd.

the class AbstractReAuthenticationFilterTest method setUp.

@BeforeEach
void setUp() {
    response = new MockHttpServletResponse();
    filterChain = mock(FilterChain.class);
    securityService = mock(SecurityService.class);
    systemEnvironment = mock(SystemEnvironment.class);
    when(systemEnvironment.isReAuthenticationEnabled()).thenReturn(true);
    passwordBasedPluginAuthenticationProvider = mock(PasswordBasedPluginAuthenticationProvider.class);
    webBasedPluginAuthenticationProvider = mock(WebBasedPluginAuthenticationProvider.class);
    anonymousAuthenticationProvider = mock(AnonymousAuthenticationProvider.class);
    clock = new TestingClock();
    filter = spy(new AbstractReAuthenticationFilter(securityService, systemEnvironment, clock, passwordBasedPluginAuthenticationProvider, webBasedPluginAuthenticationProvider, anonymousAuthenticationProvider) {

        @Override
        protected void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, String errorMessage) throws IOException {
        }
    });
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) HttpServletRequest(javax.servlet.http.HttpServletRequest) PasswordBasedPluginAuthenticationProvider(com.thoughtworks.go.server.newsecurity.providers.PasswordBasedPluginAuthenticationProvider) SecurityService(com.thoughtworks.go.server.service.SecurityService) FilterChain(javax.servlet.FilterChain) WebBasedPluginAuthenticationProvider(com.thoughtworks.go.server.newsecurity.providers.WebBasedPluginAuthenticationProvider) HttpServletResponse(javax.servlet.http.HttpServletResponse) AnonymousAuthenticationProvider(com.thoughtworks.go.server.newsecurity.providers.AnonymousAuthenticationProvider) TestingClock(com.thoughtworks.go.util.TestingClock) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

AnonymousAuthenticationProvider (com.thoughtworks.go.server.newsecurity.providers.AnonymousAuthenticationProvider)1 PasswordBasedPluginAuthenticationProvider (com.thoughtworks.go.server.newsecurity.providers.PasswordBasedPluginAuthenticationProvider)1 WebBasedPluginAuthenticationProvider (com.thoughtworks.go.server.newsecurity.providers.WebBasedPluginAuthenticationProvider)1 SecurityService (com.thoughtworks.go.server.service.SecurityService)1 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)1 TestingClock (com.thoughtworks.go.util.TestingClock)1 FilterChain (javax.servlet.FilterChain)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1