use of org.springframework.security.web.authentication.logout.CookieClearingLogoutHandler in project pigatron-web by pigatron-industries.
the class AdminSecurityController method logout.
// @RequestMapping(value = "/${url.admin}/login", method = RequestMethod.GET)
// public String adminLogin() {
// if(userRepository.count() == 0) {
// return VIEW_CONFIGURE;
// } else {
// return VIEW_ADMINLOGIN;
// }
// }
// @RequestMapping(value = "/${url.setup}", method = RequestMethod.POST)
// public String setup(@ModelAttribute CreateUserForm configurationForm) {
// if(userRepository.count() == 0) {
// secUserDetailsService.createAdminUser(configurationForm.getAdminUsername(), configurationForm.getAdminPassword());
// return "redirect:/" + adminUrl;
// } else {
// throw new ResourceNotFoundException();
// }
// }
@RequestMapping(value = "/logout", method = RequestMethod.POST)
@ResponseBody
public void logout(HttpServletRequest request, HttpServletResponse response) throws ServletException {
CookieClearingLogoutHandler cookieClearingLogoutHandler = new CookieClearingLogoutHandler(AbstractRememberMeServices.SPRING_SECURITY_REMEMBER_ME_COOKIE_KEY);
SecurityContextLogoutHandler securityContextLogoutHandler = new SecurityContextLogoutHandler();
cookieClearingLogoutHandler.logout(request, response, null);
securityContextLogoutHandler.logout(request, response, null);
}
use of org.springframework.security.web.authentication.logout.CookieClearingLogoutHandler in project steve by RWTH-i5-IDSG.
the class SignOutController method signOut.
@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";
}
use of org.springframework.security.web.authentication.logout.CookieClearingLogoutHandler in project tutorials by eugenp.
the class AuthController method logout.
@GetMapping("/logout")
public String logout(HttpServletRequest request, HttpServletResponse response, SecurityContextLogoutHandler logoutHandler) {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
logoutHandler.logout(request, response, auth);
new CookieClearingLogoutHandler(AbstractRememberMeServices.SPRING_SECURITY_REMEMBER_ME_COOKIE_KEY).logout(request, response, auth);
return "auth/logout";
}
use of org.springframework.security.web.authentication.logout.CookieClearingLogoutHandler in project esup-papercut by EsupPortail.
the class AuthController method logout.
@GetMapping("/logout")
public String logout(HttpServletRequest request, HttpServletResponse response, SecurityContextLogoutHandler logoutHandler) {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
logoutHandler.logout(request, response, auth);
new CookieClearingLogoutHandler(AbstractRememberMeServices.SPRING_SECURITY_REMEMBER_ME_COOKIE_KEY).logout(request, response, auth);
return "auth/logout";
}
Aggregations