@Test void redirectToAuthorizationEndpointScenario() throws Exception { String realm = "realm_sk"; String clientId = "seat-matching"; String identityProviderHost = "https: String redirectUrl = identityProviderHost + oidcConfiguration.getAuthorizationEndpoint(). replace(OidcConfiguration.CLIENT_ID_PLACEHOLDER, clientId). replace(OidcConfiguration.REALM_PLACEHOLDER, realm); redirectAwareFilter.setEnableFilter(true); oidcConfiguration.setClientId(clientId); oidcConfiguration.setIdentityProviderHost(identityProviderHost); securityTestFilter.state = SecurityTestFilter.State.BEARER_NOT_FOUND; authorizationStubFilter.setEnableFilter(false); MvcResult mvcResult = mockMvc.perform(get("/security/realm/users/156") .accept(MediaType.APPLICATION_JSON_VALUE) .param("realm", realm) .contentType(MediaType.APPLICATION_JSON_VALUE) .content(getStub("security-users-test.json"))) .andDo(print()).andExpect(status().isFound()).andReturn(); String expectedRedirectUrl = mvcResult.getResponse().getRedirectedUrl(); redirectUrl = redirectUrl.replace(OidcConfiguration.REDIRECT_URI_PLACEHOLDER, URLEncoder.encode(mvcResult.getRequest().getRequestURL().toString(), "UTF-8")); assertThat(expectedRedirectUrl, is(redirectUrl)); authorizationStubFilter.setEnableFilter(true); }
public void setEnableFilter(boolean enabled) { this.enableFilter = enabled; }
AuthenticationOAuth2RedirectAwareFilter implements Filter { public void setEnableFilter(boolean enabled) { this.enableFilter = enabled; } }
AuthenticationOAuth2RedirectAwareFilter implements Filter { public void setEnableFilter(boolean enabled) { this.enableFilter = enabled; } @Autowired  AuthenticationOAuth2RedirectAwareFilter(AuthorizationStubFilter authorizationStubFilter,
                                                   OidcAuthenticationHelper oidcHelper,
                                                   OidcConfiguration oidcConfiguration,
                                                   SecurityConfig securityConfig); }
AuthenticationOAuth2RedirectAwareFilter implements Filter { public void setEnableFilter(boolean enabled) { this.enableFilter = enabled; } @Autowired  AuthenticationOAuth2RedirectAwareFilter(AuthorizationStubFilter authorizationStubFilter,
                                                   OidcAuthenticationHelper oidcHelper,
                                                   OidcConfiguration oidcConfiguration,
                                                   SecurityConfig securityConfig); @Override void init(FilterConfig filterConfig); @Override void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain); @Override void destroy(); void setEnableFilter(boolean enabled); }
AuthenticationOAuth2RedirectAwareFilter implements Filter { public void setEnableFilter(boolean enabled) { this.enableFilter = enabled; } @Autowired  AuthenticationOAuth2RedirectAwareFilter(AuthorizationStubFilter authorizationStubFilter,
                                                   OidcAuthenticationHelper oidcHelper,
                                                   OidcConfiguration oidcConfiguration,
                                                   SecurityConfig securityConfig); @Override void init(FilterConfig filterConfig); @Override void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain); @Override void destroy(); void setEnableFilter(boolean enabled);  }