@Test public void onAuthenticationSuccessWithTargetUrlParameter () { chaosAuthenticationSuccessHandler.setAlwaysUseDefaultTargetUrl(false); chaosAuthenticationSuccessHandler.setTargetUrlParameter("/not empty!"); chaosAuthenticationSuccessHandler.onAuthenticationSuccess(request, response, exception); verify(httpSessionRequestCache, times(1)).removeRequest(request, response); }
@Override public void onAuthenticationSuccess (HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) { ChaosWebSecurity.logSuccessfulRequest("Authentication success", httpServletRequest); SavedRequest request = requestCache.getRequest(httpServletRequest, httpServletResponse); if (request == null) { clearAuthenticationAttributes(httpServletRequest); return; } String targetUrlParameter = getTargetUrlParameter(); if (isAlwaysUseDefaultTargetUrl() || (targetUrlParameter != null && !targetUrlParameter.isEmpty())) { requestCache.removeRequest(httpServletRequest, httpServletResponse); clearAuthenticationAttributes(httpServletRequest); return; } clearAuthenticationAttributes(httpServletRequest); }
ChaosAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuccessHandler { @Override public void onAuthenticationSuccess (HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) { ChaosWebSecurity.logSuccessfulRequest("Authentication success", httpServletRequest); SavedRequest request = requestCache.getRequest(httpServletRequest, httpServletResponse); if (request == null) { clearAuthenticationAttributes(httpServletRequest); return; } String targetUrlParameter = getTargetUrlParameter(); if (isAlwaysUseDefaultTargetUrl() || (targetUrlParameter != null && !targetUrlParameter.isEmpty())) { requestCache.removeRequest(httpServletRequest, httpServletResponse); clearAuthenticationAttributes(httpServletRequest); return; } clearAuthenticationAttributes(httpServletRequest); } }
ChaosAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuccessHandler { @Override public void onAuthenticationSuccess (HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) { ChaosWebSecurity.logSuccessfulRequest("Authentication success", httpServletRequest); SavedRequest request = requestCache.getRequest(httpServletRequest, httpServletResponse); if (request == null) { clearAuthenticationAttributes(httpServletRequest); return; } String targetUrlParameter = getTargetUrlParameter(); if (isAlwaysUseDefaultTargetUrl() || (targetUrlParameter != null && !targetUrlParameter.isEmpty())) { requestCache.removeRequest(httpServletRequest, httpServletResponse); clearAuthenticationAttributes(httpServletRequest); return; } clearAuthenticationAttributes(httpServletRequest); } @Autowired  ChaosAuthenticationSuccessHandler();   ChaosAuthenticationSuccessHandler(HttpSessionRequestCache requestCache); }
ChaosAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuccessHandler { @Override public void onAuthenticationSuccess (HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) { ChaosWebSecurity.logSuccessfulRequest("Authentication success", httpServletRequest); SavedRequest request = requestCache.getRequest(httpServletRequest, httpServletResponse); if (request == null) { clearAuthenticationAttributes(httpServletRequest); return; } String targetUrlParameter = getTargetUrlParameter(); if (isAlwaysUseDefaultTargetUrl() || (targetUrlParameter != null && !targetUrlParameter.isEmpty())) { requestCache.removeRequest(httpServletRequest, httpServletResponse); clearAuthenticationAttributes(httpServletRequest); return; } clearAuthenticationAttributes(httpServletRequest); } @Autowired  ChaosAuthenticationSuccessHandler();   ChaosAuthenticationSuccessHandler(HttpSessionRequestCache requestCache); @Override void onAuthenticationSuccess(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication); }
ChaosAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuccessHandler { @Override public void onAuthenticationSuccess (HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) { ChaosWebSecurity.logSuccessfulRequest("Authentication success", httpServletRequest); SavedRequest request = requestCache.getRequest(httpServletRequest, httpServletResponse); if (request == null) { clearAuthenticationAttributes(httpServletRequest); return; } String targetUrlParameter = getTargetUrlParameter(); if (isAlwaysUseDefaultTargetUrl() || (targetUrlParameter != null && !targetUrlParameter.isEmpty())) { requestCache.removeRequest(httpServletRequest, httpServletResponse); clearAuthenticationAttributes(httpServletRequest); return; } clearAuthenticationAttributes(httpServletRequest); } @Autowired  ChaosAuthenticationSuccessHandler();   ChaosAuthenticationSuccessHandler(HttpSessionRequestCache requestCache); @Override void onAuthenticationSuccess(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication);  }