for (String scheme : delegationAuthSchemes) { if (AuthenticationHandlerUtil. matchAuthScheme(scheme, authorization)) { schemeConfigured = true; break;
@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; } }
|| !AuthenticationHandlerUtil.matchAuthScheme(HttpConstants.BASIC, authorization)) { response.setHeader(WWW_AUTHENTICATE, HttpConstants.BASIC);
|| !AuthenticationHandlerUtil.matchAuthScheme(HttpConstants.BASIC, authorization)) { response.setHeader(WWW_AUTHENTICATE, HttpConstants.BASIC);
|| !AuthenticationHandlerUtil.matchAuthScheme(HttpConstants.BASIC, authorization)) { response.setHeader(WWW_AUTHENTICATE, HttpConstants.BASIC);
for (String scheme : delegationAuthSchemes) { if (AuthenticationHandlerUtil. matchAuthScheme(scheme, authorization)) { schemeConfigured = true; break;