All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fr.smallcrew.security.web.LogoutController Maven / Gradle / Ivy

Go to download

Foundation of all smallcrew's projects needing authenticated users and role management

The newest version!
package fr.smallcrew.security.web;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/logout")
public class LogoutController {

  @RequestMapping(method = RequestMethod.GET)
  public void logout() {
    SecurityContextHolder.getContext().setAuthentication(null);
    SecurityContextHolder.clearContext();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy