WhitelistLogoutHandler extends SimpleUrlLogoutSuccessHandler { @Override protected String determineTargetUrl(HttpServletRequest request, HttpServletResponse response) { String targetUrl = super.determineTargetUrl(request, response); if(isInternalRedirect(targetUrl, request)) { return targetUrl; } String defaultTargetUrl = getDefaultTargetUrl(); if (targetUrl.equals(defaultTargetUrl)) { return targetUrl; } Set<String> clientWhitelist = getClientWhitelist(request); Set<String> combinedWhitelist = combineSets(whitelist, clientWhitelist); return findMatchingRedirectUri(combinedWhitelist, targetUrl, defaultTargetUrl); } WhitelistLogoutHandler(List<String> whitelist); void setWhitelist(List<String> whitelist); MultitenantClientServices getClientDetailsService(); void setClientDetailsService(MultitenantClientServices clientDetailsService);  }
@Test void test_default_redirect_uri() { assertEquals("/login", handler.determineTargetUrl(request, response)); assertEquals("/login", handler.determineTargetUrl(request, response)); handler.setAlwaysUseDefaultTargetUrl(false); assertEquals("/login", handler.determineTargetUrl(request, response)); }