private String getLoginRedirectUrl(HttpServletRequest request) { final StringBuffer callback = request.getRequestURL(); if (!StringUtils.isBlank(request.getQueryString())) { callback.append("?").append(request.getQueryString()); } return loginProvider.getLoginUriForRole(URI.create(callback.toString()), UserRole.ADMIN).toASCIIString(); } }
/** * Handles access denied as decided by this filter. * By default, we simply redirect to a login page. Override this method if you want it to do something else. * * @param request request * @param response response * @throws java.io.IOException IOException */ protected void handleAccessDenied(HttpServletRequest request, HttpServletResponse response) throws IOException { // By default, we redirect to login page so if user actually has the privilege, he will eventually get // redirected to the right page after the login. response.sendRedirect(loginUriProvider.getLoginUriForRole(getOriginalUrl(request), getForRole(), EnumSet.of(PageCapability.IFRAME)).toASCIIString()); }
/** * Handles access denied as decided by this filter. * By default, we simply redirect to a login page. Override this method if you want it to do something else. * * @param request request * @param response response * @throws java.io.IOException IOException */ protected void handleAccessDenied(HttpServletRequest request, HttpServletResponse response) throws IOException { // By default, we redirect to login page so if user actually has the privilege, he will eventually get // redirected to the right page after the login. response.sendRedirect(loginUriProvider.getLoginUriForRole(getOriginalUrl(request), getForRole(), EnumSet.of(PageCapability.IFRAME)).toASCIIString()); }