token = authHandler.authenticate(request, response);
if (dtOp.requiresKerberosCredentials() && token == null) { token = authHandler.authenticate(request, response); LOG.trace("Got token: {}.", token); if (token == null) {
log.debug("Request [{%s}] triggering authentication", getRequestURL(httpRequest)); token = getAuthenticationHandler().authenticate(httpRequest, httpResponse); if (token != null && token.getExpires() != 0 && token != AuthenticationToken.ANONYMOUS) {
@Override public AuthenticationToken authenticate(HttpServletRequest request, HttpServletResponse response) throws IOException, AuthenticationException { String authorization = request.getHeader(HttpConstants.AUTHORIZATION_HEADER); if (authorization != null) { for (Map.Entry<String, AuthenticationHandler> entry : schemeToAuthHandlerMapping.entrySet()) { if (AuthenticationHandlerUtil.matchAuthScheme( entry.getKey(), authorization)) { AuthenticationToken token = entry.getValue().authenticate(request, response); logger.trace("Token generated with type {}", token.getType()); return token; } } } // Handle the case when (authorization == null) or an invalid authorization // header (e.g. a header value without the scheme name). response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); for (String scheme : schemeToAuthHandlerMapping.keySet()) { response.addHeader(HttpConstants.WWW_AUTHENTICATE_HEADER, scheme); } return null; } }
@Override public AuthenticationToken authenticate(HttpServletRequest request, HttpServletResponse response) throws IOException, AuthenticationException { String authorization = request.getHeader(HttpConstants.AUTHORIZATION_HEADER); if (authorization != null) { for (String scheme : schemeToAuthHandlerMapping.keySet()) { if (AuthenticationHandlerUtil.matchAuthScheme(scheme, authorization)) { AuthenticationHandler handler = schemeToAuthHandlerMapping.get(scheme); AuthenticationToken token = handler.authenticate(request, response); logger.trace("Token generated with type {}", token.getType()); return token; } } } // Handle the case when (authorization == null) or an invalid authorization // header (e.g. a header value without the scheme name). response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); for (String scheme : schemeToAuthHandlerMapping.keySet()) { response.addHeader(HttpConstants.WWW_AUTHENTICATE_HEADER, scheme); } return null; } }
@Override public AuthenticationToken authenticate(HttpServletRequest request, HttpServletResponse response) throws IOException, AuthenticationException { String authorization = request.getHeader(HttpConstants.AUTHORIZATION_HEADER); if (authorization != null) { for (String scheme : schemeToAuthHandlerMapping.keySet()) { if (AuthenticationHandlerUtil.matchAuthScheme(scheme, authorization)) { AuthenticationHandler handler = schemeToAuthHandlerMapping.get(scheme); AuthenticationToken token = handler.authenticate(request, response); logger.trace("Token generated with type {}", token.getType()); return token; } } } // Handle the case when (authorization == null) or an invalid authorization // header (e.g. a header value without the scheme name). response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); for (String scheme : schemeToAuthHandlerMapping.keySet()) { response.addHeader(HttpConstants.WWW_AUTHENTICATE_HEADER, scheme); } return null; } }
AuthenticationHandler handler = new AuthenticationHandlerImpl(); Authenticator authenticator = new HTTPClientAuthenticator(); //or //Authenticator authenticator = new URLAuthenticator(); authenticator.setLogin(...); authenticator.setPassword(...); handler.setAuthenticator(authenticator) handler.authenticate();
if (dtOp.requiresKerberosCredentials() && token == null) { token = authHandler.authenticate(request, response); if (token == null) { requestContinues = false;
token = authHandler.authenticate(request, response);
token = authHandler.authenticate(httpRequest, httpResponse);
token = authHandler.authenticate(request, response);
token = authHandler.authenticate(request, response);
token = authHandler.authenticate(request, response);
LOG.debug("Request [{}] triggering authentication", getRequestURL(httpRequest)); token = authHandler.authenticate(httpRequest, httpResponse); if (token != null && token.getExpires() != 0 && token != AuthenticationToken.ANONYMOUS) {
LOG.debug("Request [{}] triggering authentication", getRequestURL(httpRequest)); token = authHandler.authenticate(httpRequest, httpResponse); if (token != null && token.getExpires() != 0 && token != AuthenticationToken.ANONYMOUS) {
getRequestURL(httpRequest), authHandler.getClass()); token = authHandler.authenticate(httpRequest, httpResponse); if (token != null && token != AuthenticationToken.ANONYMOUS) { if (token.getMaxInactives() > 0) {
getRequestURL(httpRequest)); token = authHandler.authenticate(httpRequest, httpResponse); if (token != null && token != AuthenticationToken.ANONYMOUS) { if (token.getMaxInactives() > 0) {
getRequestURL(httpRequest)); token = authHandler.authenticate(httpRequest, httpResponse); if (token != null && token != AuthenticationToken.ANONYMOUS) { if (token.getMaxInactives() > 0) {
LOG.debug("Request [{}] triggering authentication", getRequestURL(httpRequest)); token = authHandler.authenticate(httpRequest, httpResponse); if (token != null && token.getExpires() != 0 && token != AuthenticationToken.ANONYMOUS) {