if (DeferredAuthentication.isDeferred(response)) return Authentication.UNAUTHENTICATED;
if (DeferredAuthentication.isDeferred(response)) return Authentication.UNAUTHENTICATED;
if (!DeferredAuthentication.isDeferred(response))
if (!DeferredAuthentication.isDeferred(response))
if (DeferredAuthentication.isDeferred(res))
return new DeferredAuthentication(this); if (isLoginOrErrorPage(URIUtil.addPaths(request.getServletPath(),request.getPathInfo())) &&!DeferredAuthentication.isDeferred(response)) return new DeferredAuthentication(this); if (DeferredAuthentication.isDeferred(response))
if (identity.isEstablished()) if (!DeferredAuthentication.isDeferred(response)) if (DeferredAuthentication.isDeferred(response)) return Authentication.UNAUTHENTICATED; if (LOG.isDebugEnabled()) if (DeferredAuthentication.isDeferred(response)) return Authentication.UNAUTHENTICATED;
/** * Jetty has a bug in which if there is an Authorization header sent by a client which is * not of the Negotiate type, Jetty does not send the challenge to negotiate. This works * around that issue, forcing the challenge to be sent. Will require investigation on * upgrade to a newer version of Jetty. */ Authentication sendChallengeIfNecessary(Authentication computedAuth, ServletRequest request, ServletResponse response) throws IOException { if (computedAuth == Authentication.UNAUTHENTICATED) { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse res = (HttpServletResponse) response; String header = req.getHeader(HttpHeader.AUTHORIZATION.asString()); // We have an authorization header, but it's not Negotiate if (header != null && !header.startsWith(HttpHeader.NEGOTIATE.asString())) { LOG.debug("Client sent Authorization header that was not for Negotiate," + " sending challenge anyways."); if (DeferredAuthentication.isDeferred(res)) { return Authentication.UNAUTHENTICATED; } res.setHeader(HttpHeader.WWW_AUTHENTICATE.asString(), HttpHeader.NEGOTIATE.asString()); res.sendError(HttpServletResponse.SC_UNAUTHORIZED); return Authentication.SEND_CONTINUE; } } return computedAuth; } }
/** * Jetty has a bug in which if there is an Authorization header sent by a client which is * not of the Negotiate type, Jetty does not send the challenge to negotiate. This works * around that issue, forcing the challenge to be sent. Will require investigation on * upgrade to a newer version of Jetty. */ Authentication sendChallengeIfNecessary(Authentication computedAuth, ServletRequest request, ServletResponse response) throws IOException { if (computedAuth == Authentication.UNAUTHENTICATED) { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse res = (HttpServletResponse) response; String header = req.getHeader(HttpHeader.AUTHORIZATION.asString()); // We have an authorization header, but it's not Negotiate if (header != null && !header.startsWith(HttpHeader.NEGOTIATE.asString())) { LOG.debug("Client sent Authorization header that was not for Negotiate," + " sending challenge anyways."); if (DeferredAuthentication.isDeferred(res)) { return Authentication.UNAUTHENTICATED; } res.setHeader(HttpHeader.WWW_AUTHENTICATE.asString(), HttpHeader.NEGOTIATE.asString()); res.sendError(HttpServletResponse.SC_UNAUTHORIZED); return Authentication.SEND_CONTINUE; } } return computedAuth; } }
if (DeferredAuthentication.isDeferred(response)) return Authentication.UNAUTHENTICATED;
if (DeferredAuthentication.isDeferred(response)) return Authentication.UNAUTHENTICATED;
if (DeferredAuthentication.isDeferred(response)) return Authentication.UNAUTHENTICATED;
if (DeferredAuthentication.isDeferred(response)) return Authentication.UNAUTHENTICATED;
if (DeferredAuthentication.isDeferred(res))
if (DeferredAuthentication.isDeferred(res))
if (DeferredAuthentication.isDeferred(res))
if (DeferredAuthentication.isDeferred(res))
if (DeferredAuthentication.isDeferred(res))
if (DeferredAuthentication.isDeferred(res))
if (!DeferredAuthentication.isDeferred(response))