return Authentication.SEND_CONTINUE; } catch (IOException e) { throw new ServerAuthException(e);
@Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException { baseRequest.setHandled(true); try { Authentication authentication = digestAuthenticator.validateRequest(request, response, true); if (authentication instanceof Authentication.User) { response.setContentType("text/plain"); Authentication.User user = (Authentication.User) authentication; response.getWriter().println(user.getAuthMethod()); } else if (authentication instanceof Authentication.ResponseSent) { Authentication.ResponseSent responseSent = (Authentication.ResponseSent) authentication; } } catch (ServerAuthException e) { e.printStackTrace(); } } }
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
response.sendError(Response.SC_INTERNAL_SERVER_ERROR, e.getMessage());
private void sendChallenge(HttpServletResponse response, String token) throws ServerAuthException { try { setSpnegoToken(response, token); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } catch (IOException x) { throw new ServerAuthException(x); } }
response.sendError(Response.SC_INTERNAL_SERVER_ERROR, e.getMessage());
response.sendError(Response.SC_INTERNAL_SERVER_ERROR, e.getMessage());
response.sendError(Response.SC_INTERNAL_SERVER_ERROR, e.getMessage());
throw new ServerAuthException(e.getMessage());
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
throw new ServerAuthException(ioe);
response.sendError(Response.SC_INTERNAL_SERVER_ERROR, e.getMessage());
response.sendError(Response.SC_INTERNAL_SERVER_ERROR, e.getMessage());
private void redirectToCas( final HttpServletRequest request, final HttpServletResponse response) throws ServerAuthException { try { final String redirectUrl = CommonUtils.constructRedirectUrl( casServerLoginUrl, protocol.getServiceParameterName(), serviceUrl(request, response), renew, false); logger.debug("Redirecting to {}", redirectUrl); response.sendRedirect(redirectUrl); } catch (IOException e) { logger.debug("Redirect to CAS failed with error", e); throw new ServerAuthException("Redirect to CAS failed", e); } } }
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
@Override public Authentication validateRequest(ServletRequest request, ServletResponse response, boolean mandatory) throws ServerAuthException { final Authentication computedAuth = super.validateRequest(request, response, mandatory); try { return sendChallengeIfNecessary(computedAuth, request, response); } catch (IOException e) { throw new ServerAuthException(e); } }
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());