Revision 57677
Added by Michele Artini over 4 years ago
MyAccessDeniedHandler.java | ||
---|---|---|
20 | 20 |
private static Logger logger = LoggerFactory.getLogger(MyAccessDeniedHandler.class); |
21 | 21 |
|
22 | 22 |
@Override |
23 |
public void handle(final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse, final AccessDeniedException e)
|
|
23 |
public void handle(final HttpServletRequest req, final HttpServletResponse res, final AccessDeniedException e)
|
|
24 | 24 |
throws IOException, ServletException { |
25 | 25 |
|
26 | 26 |
final Authentication auth = SecurityContextHolder.getContext().getAuthentication(); |
27 | 27 |
|
28 | 28 |
if (auth != null) { |
29 |
logger.warn(String.format("User '%s' attempted to access the protected URL: %s", auth.getName(), httpServletRequest.getRequestURI()));
|
|
29 |
logger.warn(String.format("User '%s' attempted to access the protected URL: %s", auth.getName(), req.getRequestURI()));
|
|
30 | 30 |
} |
31 | 31 |
|
32 |
httpServletResponse.sendRedirect(httpServletRequest.getContextPath() + "/authorizationRequest");
|
|
32 |
res.sendRedirect(req.getContextPath() + "/authorizationRequest");
|
|
33 | 33 |
} |
34 | 34 |
|
35 | 35 |
} |
Also available in: Unified diff
redirect to login after expired ajax calls