getRedirectStrategy().sendRedirect(request, response, failureUrl); } else { super.onAuthenticationFailure(request, response, exception);
AuthenticationException e = new AuthenticationServiceException(cause.getMessage(), cause.getCause()); logger.debug(cause); super.onAuthenticationFailure(request, response, e); super.onAuthenticationFailure(request, response, exception);
getRedirectStrategy().sendRedirect(request, response, failureUrl); } else { super.onAuthenticationFailure(request, response, exception);
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { super.onAuthenticationFailure(request, response, exception); } }
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { super.onAuthenticationFailure(request, response, exception); } }
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { super.onAuthenticationFailure(request, response, exception); } }
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { super.onAuthenticationFailure(request, response, exception); } }
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { request.setAttribute(UsernamePasswordAuthenticationFilter.SPRING_SECURITY_FORM_USERNAME_KEY, request.getParameter(UsernamePasswordAuthenticationFilter.SPRING_SECURITY_FORM_USERNAME_KEY)); super.onAuthenticationFailure(request, response, exception); }
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { if (exception instanceof ExpiredTokenException) { // Just redirect back to the original URL and re-start the authentication process. response.sendRedirect(request.getRequestURL().toString()); return; } super.onAuthenticationFailure(request, response, exception); }
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { String url = failureUrlMap.get(exception.getClass().getName()); if (url != null) { getRedirectStrategy().sendRedirect(request, response, url); } else { super.onAuthenticationFailure(request, response, exception); } }
@Override public void onAuthenticationFailure(final HttpServletRequest request, final HttpServletResponse response, final AuthenticationException exception) throws IOException, ServletException { if (checker.isMobileRequest(request)) { logger.debug("Mobile flag, no failure url set, sending 401 Unauthorized error"); response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Authentication Failed: " + exception.getMessage()); } else { super.onAuthenticationFailure(request, response, exception); } } }
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { // First see if we want to handle the request in some custom way if (requestHandler != null && requestHandler.canHandleRequest(request)) { requestHandler.handleRequest(request, response); return; } if (exception instanceof ExpiredTokenException) { // Just redirect back to the original URL and re-start the authentication process. response.sendRedirect(request.getRequestURL().toString()); return; } super.onAuthenticationFailure(request, response, exception); }
/** * {@inheritDoc} */ @Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { HttpSession session = request.getSession(false); if ((session != null || isAllowSessionCreation()) && exception.getAuthentication() != null) { request.getSession().setAttribute(usernameSessionAttribute, exception.getAuthentication().getName()); } super.onAuthenticationFailure(request, response, exception); }
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { logger.error("登陆失败"); if (LoginType.JSON.equals(securityProperties.getBrowser().getLoginType())) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); response.setContentType("application/json;charset=UTF-8"); response.getWriter().write(objectMapper.writeValueAsString(new SimpleResponse(exception.getMessage()))); } else { super.onAuthenticationFailure(request, response, exception); } } }
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { logger.info("登录失败"); if (LoginResponseType.JSON.equals(securityProperties.getBrowser().getLoginType())) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); response.setContentType("application/json;charset=UTF-8"); response.getWriter().write(objectMapper.writeValueAsString(new BaseResponse(exception.getMessage()))); }else{ super.onAuthenticationFailure(request, response, exception); } } }
@Override public void onAuthenticationFailure(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException exception) throws IOException, ServletException { logger.info("登录失败"); if(LoginType.JSON.equals(securityProperties.getBrowser().getLoginType())){ httpServletResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); httpServletResponse.setContentType("application/json;charset=UTF-8"); //将authentication这个对象转成json格式的字符串 httpServletResponse.getWriter().write(objectMapper.writeValueAsString(new SimpleResponse(exception.getMessage()))); } else { super.onAuthenticationFailure(httpServletRequest, httpServletResponse, exception); } } }
@Override public void onAuthenticationFailure(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException exception) throws IOException, ServletException { logger.info("登录失败"); if(LoginType.JSON.equals(securityProperties.getBrowser().getLoginType())){ httpServletResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); httpServletResponse.setContentType("application/json;charset=UTF-8"); //将authentication这个对象转成json格式的字符串 httpServletResponse.getWriter().write(objectMapper.writeValueAsString(new SimpleResponse(exception.getMessage()))); } else { super.onAuthenticationFailure(httpServletRequest, httpServletResponse, exception); } } }
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { logger.info("登录失败"); // 判断是用哪一种方式进行登录的 // 如果是JSON,则返回JSON字符串;否则进行页面的跳转 if (LoginResponseType.JSON.equals(securityProperties.getBrowser().getLoginType())) { response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()); response.setContentType("application/json;charset=UTF-8"); response.getWriter().write(objectMapper.writeValueAsString(new BaseResponse(exception.getMessage()))); }else{ super.onAuthenticationFailure(request, response, exception); } } }
@Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { if (isRestRequest(request)) { RestUtils.returnStatusResponse(response, HttpServletResponse.SC_UNAUTHORIZED, exception.getMessage()); } else { super.onAuthenticationFailure(request, response, exception); } }
@Override public void onAuthenticationFailure(final HttpServletRequest request, final HttpServletResponse response, final AuthenticationException exception) throws IOException, ServletException { if (TenantContextHolder.hasContext() && StringUtils.hasText(TenantUtils.getCurrentTenant())) { setDefaultFailureUrl("/" + TenantUtils.getCurrentTenant() + DEFAULT_FAILURE_URL); } else { setDefaultFailureUrl(DEFAULT_FAILURE_URL); } super.onAuthenticationFailure(request, response, exception); }