com.luues.security.core.authentication.LogoutSuccessHandler Maven / Gradle / Ivy
package com.luues.security.core.authentication;
import com.luues.security.configuration.core.adapter.WebSecurityConfigurerAdapter;
import com.luues.security.configuration.core.config.web.configurers.AbstractAuthenticationTargetUrlRequestHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class LogoutSuccessHandler extends AbstractAuthenticationTargetUrlRequestHandler.LogoutSuccessHandler {
/*@Autowired(required = false)
private List webSecurityConfigurerAdapterList = new ArrayList<>();
public LogoutSuccessHandler(List webSecurityConfigurerAdapterList){
this.webSecurityConfigurerAdapterList.clear();
webSecurityConfigurerAdapterList.forEach((v) -> this.webSecurityConfigurerAdapterList.add(v));
}*/
@Autowired
private WebSecurityConfigurerAdapter webSecurityConfigurerAdapter;
@Override
public void onLogoutSuccess(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) throws IOException, ServletException {
com.luues.security.core.interfaces.LogoutSuccessHandler logoutSuccessHandler = webSecurityConfigurerAdapter.logoutSuccessHandler();
if(null != logoutSuccessHandler){
logoutSuccessHandler.logoutSuccessHandler(httpServletRequest, httpServletResponse, authentication);
}
super.onLogoutSuccess(httpServletRequest, httpServletResponse, authentication);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy