package de.rwth.idsg.steve.web.controller; import org.springframework.security.web.authentication.logout.CookieClearingLogoutHandler; import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; import org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @author Sevket Goekay <goekay@dbis.rwth-aachen.de> * @since 15.08.2014 */ @Controller @RequestMapping(value = "/manager") public class SignOutController { @RequestMapping(value = "/signout", method = RequestMethod.GET) public String signOut(HttpServletRequest request, HttpServletResponse response) { new SecurityContextLogoutHandler() .logout(request, response, null); new CookieClearingLogoutHandler(AbstractRememberMeServices.SPRING_SECURITY_REMEMBER_ME_COOKIE_KEY) .logout(request, response, null); return "redirect:/manager/signin"; } }