use of org.springframework.security.web.authentication.logout.LogoutSuccessHandler in project kylo by Teradata.
the class CompositeLogoutSuccessHandler method onLogoutSuccess.
/* (non-Javadoc)
* @see org.springframework.security.web.authentication.logout.LogoutSuccessHandler#onLogoutSuccess(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.security.core.Authentication)
*/
@Override
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
IOException ioe = null;
ServletException se = null;
RuntimeException re = null;
// Ensure all componentHandlers get called even though there is an exception thrown;
for (LogoutSuccessHandler handler : this.componentHandlers) {
try {
handler.onLogoutSuccess(request, response, authentication);
} catch (IOException e) {
log.error("IOException thrown by a LogoutSuccessHandler after logout", e);
if (ioe != null)
ioe = e;
} catch (ServletException e) {
log.error("ServletException thrown by a LogoutSuccessHandler after logout", e);
if (se != null)
se = e;
} catch (RuntimeException e) {
log.error("RuntimeException thrown by a LogoutSuccessHandler after logout", e);
if (re != null)
re = e;
}
}
// Throw one of the exceptions if any occurred.
if (ioe != null)
throw ioe;
if (se != null)
throw se;
if (re != null)
throw re;
}
use of org.springframework.security.web.authentication.logout.LogoutSuccessHandler in project spring-security by spring-projects.
the class LogoutConfigurer method getLogoutSuccessHandler.
/**
* Gets the {@link LogoutSuccessHandler} if not null, otherwise creates a new
* {@link SimpleUrlLogoutSuccessHandler} using the {@link #logoutSuccessUrl(String)}.
* @return the {@link LogoutSuccessHandler} to use
*/
public LogoutSuccessHandler getLogoutSuccessHandler() {
LogoutSuccessHandler handler = this.logoutSuccessHandler;
if (handler == null) {
handler = createDefaultSuccessHandler();
this.logoutSuccessHandler = handler;
}
return handler;
}
use of org.springframework.security.web.authentication.logout.LogoutSuccessHandler in project spring-security by spring-projects.
the class Saml2LogoutConfigurerTests method saml2LogoutWhenCsrfDisabledAndNoAuthenticationThenFinalRedirect.
@Test
public void saml2LogoutWhenCsrfDisabledAndNoAuthenticationThenFinalRedirect() throws Exception {
this.spring.register(Saml2LogoutCsrfDisabledConfig.class).autowire();
this.mvc.perform(post("/logout"));
LogoutSuccessHandler logoutSuccessHandler = this.spring.getContext().getBean(LogoutSuccessHandler.class);
verify(logoutSuccessHandler).onLogoutSuccess(any(), any(), any());
}
Aggregations