@RequestMapping(value = "/403", method = RequestMethod.GET)
public ModelAndView accesssDenied() {
final ModelAndView model = new ModelAndView();
// check if user is login
final Authentication auth = SecurityContextHolder.getContext()
.getAuthentication();
if (!(auth instanceof AnonymousAuthenticationToken)) {
final UserDetails userDetail = (UserDetails) auth.getPrincipal();
model.addObject("username", userDetail.getUsername());
}
model.setViewName("403");
return model;
}
HomeController.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:workbenchauth
作者:
评论列表
文章目录