lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hrishikesh Gadre (JIRA)" <>
Subject [jira] [Updated] (SOLR-7950) Invalid auth scheme configuration of Http client when using Kerberos (SPNEGO)
Date Wed, 26 Aug 2015 20:49:45 GMT


Hrishikesh Gadre updated SOLR-7950:
    Attachment: solr-7950-v2.patch


>>We don't support Basic + Negotiate now, right? So we need another solr patch to expose
the underlying problem?

Yes that is correct. I identified this issue while working on LDAP integration (Please refer
to  [HADOOP-12082|]). I don't think we use
the Hadoop security framework in Solr. So we may have to introduce Basic authentication scheme
(in addition to SPNEGO) in Solr by some other way.

>>There's no fall back mechanism?

No. When server supports multiple authentication schemes, client needs to pick one scheme
to use (based on list of preferences). The default configuration prefers BASIC scheme over
SPENGO. Hence the client attempts to use basic auth scheme. But since the username/password
credentials are not configured - the authentication fails. With my patch, we explicitly configure
client to use SPNEGO.

>>Or can you prefer SPNego over basic?

Yes. This can be done by adding SPNEGO before BASIC in the preference list. Here is how the
default preferences are initialized.

I think when we configure HttpClientUtil with Krb5HttpClientConfigurer, we intend to use Kerberos
authentication mechanism on the client side. Hence I think just configuring one auth scheme
(SPNEGO in this case) is preferable than SPNEGO & BASIC

I have also updated the patch to fix a unit test failure.

> Invalid auth scheme configuration of Http client when using Kerberos (SPNEGO)
> -----------------------------------------------------------------------------
>                 Key: SOLR-7950
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.10.3, Trunk
>            Reporter: Hrishikesh Gadre
>            Assignee: Gregory Chanan
>         Attachments: solr-7950-v2.patch, solr-7950.patch
> When using kerberos authentication mechanism (SPNEGO auth scheme), the Apache Http client
is incorrectly configured with *all* auth schemes (e.g. Basic, Digest, NTLM, Kerberos, Negotiate
etc.) instead of just 'Negotiate'. 
> This issue was identified after configuring Solr with both Basic + Negotiate authentication
schemes simultaneously. The problem in this case is that Http client is configured with Kerberos
credentials and the default (and incorrect) auth scheme configuration prefers Basic authentication
over Kerberos. Since the basic authentication credentials are missing, the authentication
and as a result the Http request fails. (I ran into this problem while creating a collection
where there is an internal communication between Solr servers).
> The root cause for this issue is that, AbstractHttpClient::getAuthSchemes() API call
prepares an AuthSchemeRegistry instance with all possible authentication schemes. Hence when
we register the SPNEGO auth scheme in Solr codebase, it overrides the previous configuration
for SPNEGO - but doesn't remove the other auth schemes from the client configuration. Please
take a look at relevant code snippet.
> A trivial fix would be to prepare a new AuthSchemeRegistry instance configured with just
SPENGO mechanism and set it in the HttpClient.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message