LOG.debug("Authentication challenge without {} header", header);
forwardFailureComplete(request, null, response, new HttpResponseException("HTTP protocol violation: Authentication challenge without " + header + " header", response));
return;
}
Authentication authentication = null;
Authentication.HeaderInfo headerInfo = null;
URI uri = getAuthenticationURI(request);
if (uri != null)
{
for (Authentication.HeaderInfo element : headerInfos)
{
authentication = client.getAuthenticationStore().findAuthentication(element.getType(), uri, element.getRealm());
if (authentication != null)
{
headerInfo = element;
break;
}
}
}
if (authentication == null)
{
if (LOG.isDebugEnabled())
LOG.debug("No authentication available for {}", request);
forwardSuccessComplete(request, response);
return;
}
final Authentication.Result authnResult = authentication.authenticate(request, response, headerInfo, conversation);
if (LOG.isDebugEnabled())
LOG.debug("Authentication result {}", authnResult);
if (authnResult == null)
{
forwardSuccessComplete(request, response);