You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Merlin Morgenstern <me...@gmail.com> on 2015/09/11 11:06:22 UTC

Solr authentication - Error 401 Unauthorized

I have secured solr cloud via basic authentication.

Now I am having difficulties creating cores and getting status information.
Solr keeps telling me that the request is unothorized. However, I have
access to the admin UI after login.

How do I configure solr to use the basic authentication credentials?

This is the error message:

/opt/solr-5.3.0/bin/solr status

Found 1 Solr nodes:

Solr process 31114 running on port 8983

ERROR: Failed to get system information from http://localhost:8983/solr due
to: org.apache.http.client.ClientProtocolException: Expected JSON response
from server but received: <html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<title>Error 401 Unauthorized</title>

</head>

<body><h2>HTTP ERROR 401</h2>

<p>Problem accessing /solr/admin/info/system. Reason:

<pre>    Unauthorized</pre></p><hr><i><small>Powered by
Jetty://</small></i><hr/>


</body>

</html>

Re: Solr authentication - Error 401 Unauthorized

Posted by Noble Paul <no...@gmail.com>.
It is not that solr is over protected, it is just that the clients,
SolrJ as well as bin/solr are not provided with basic auth
capabilities.

 I have opened a ticket to track this
https://issues.apache.org/jira/browse/SOLR-8048

On Sat, Sep 12, 2015 at 7:14 PM, Dan Davis <da...@gmail.com> wrote:
> Noble,
>
> You should also look at this if it is intended to be more than an internal
> API.   Using the minor protections I added to test SOLR-8000, I was able to
> reproduce a problem very like this:
>
> bin/solr healthcheck -z localhost:2181 -c mycollection
>
> Since Solr /select is protected...
>
> On Sat, Sep 12, 2015 at 9:40 AM, Dan Davis <da...@gmail.com> wrote:
>
>> It seems that you have secured Solr so thoroughly that you cannot now run
>> bin/solr status!
>>
>> bin/solr has no arguments as yet for providing a username/password - as a
>> mostly user like you I'm not sure of the roadmap.
>>
>> I think you should relax those restrictions a bit and try again.
>>
>> On Fri, Sep 11, 2015 at 5:06 AM, Merlin Morgenstern <
>> merlin.morgenstern@gmail.com> wrote:
>>
>>> I have secured solr cloud via basic authentication.
>>>
>>> Now I am having difficulties creating cores and getting status
>>> information.
>>> Solr keeps telling me that the request is unothorized. However, I have
>>> access to the admin UI after login.
>>>
>>> How do I configure solr to use the basic authentication credentials?
>>>
>>> This is the error message:
>>>
>>> /opt/solr-5.3.0/bin/solr status
>>>
>>> Found 1 Solr nodes:
>>>
>>> Solr process 31114 running on port 8983
>>>
>>> ERROR: Failed to get system information from http://localhost:8983/solr
>>> due
>>> to: org.apache.http.client.ClientProtocolException: Expected JSON response
>>> from server but received: <html>
>>>
>>> <head>
>>>
>>> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
>>>
>>> <title>Error 401 Unauthorized</title>
>>>
>>> </head>
>>>
>>> <body><h2>HTTP ERROR 401</h2>
>>>
>>> <p>Problem accessing /solr/admin/info/system. Reason:
>>>
>>> <pre>    Unauthorized</pre></p><hr><i><small>Powered by
>>> Jetty://</small></i><hr/>
>>>
>>>
>>> </body>
>>>
>>> </html>
>>>
>>
>>



-- 
-----------------------------------------------------
Noble Paul

Re: Solr authentication - Error 401 Unauthorized

Posted by Dan Davis <da...@gmail.com>.
Noble,

You should also look at this if it is intended to be more than an internal
API.   Using the minor protections I added to test SOLR-8000, I was able to
reproduce a problem very like this:

bin/solr healthcheck -z localhost:2181 -c mycollection

Since Solr /select is protected...

On Sat, Sep 12, 2015 at 9:40 AM, Dan Davis <da...@gmail.com> wrote:

> It seems that you have secured Solr so thoroughly that you cannot now run
> bin/solr status!
>
> bin/solr has no arguments as yet for providing a username/password - as a
> mostly user like you I'm not sure of the roadmap.
>
> I think you should relax those restrictions a bit and try again.
>
> On Fri, Sep 11, 2015 at 5:06 AM, Merlin Morgenstern <
> merlin.morgenstern@gmail.com> wrote:
>
>> I have secured solr cloud via basic authentication.
>>
>> Now I am having difficulties creating cores and getting status
>> information.
>> Solr keeps telling me that the request is unothorized. However, I have
>> access to the admin UI after login.
>>
>> How do I configure solr to use the basic authentication credentials?
>>
>> This is the error message:
>>
>> /opt/solr-5.3.0/bin/solr status
>>
>> Found 1 Solr nodes:
>>
>> Solr process 31114 running on port 8983
>>
>> ERROR: Failed to get system information from http://localhost:8983/solr
>> due
>> to: org.apache.http.client.ClientProtocolException: Expected JSON response
>> from server but received: <html>
>>
>> <head>
>>
>> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
>>
>> <title>Error 401 Unauthorized</title>
>>
>> </head>
>>
>> <body><h2>HTTP ERROR 401</h2>
>>
>> <p>Problem accessing /solr/admin/info/system. Reason:
>>
>> <pre>    Unauthorized</pre></p><hr><i><small>Powered by
>> Jetty://</small></i><hr/>
>>
>>
>> </body>
>>
>> </html>
>>
>
>

Re: Solr authentication - Error 401 Unauthorized

Posted by Dan Davis <da...@gmail.com>.
It seems that you have secured Solr so thoroughly that you cannot now run
bin/solr status!

bin/solr has no arguments as yet for providing a username/password - as a
mostly user like you I'm not sure of the roadmap.

I think you should relax those restrictions a bit and try again.

On Fri, Sep 11, 2015 at 5:06 AM, Merlin Morgenstern <
merlin.morgenstern@gmail.com> wrote:

> I have secured solr cloud via basic authentication.
>
> Now I am having difficulties creating cores and getting status information.
> Solr keeps telling me that the request is unothorized. However, I have
> access to the admin UI after login.
>
> How do I configure solr to use the basic authentication credentials?
>
> This is the error message:
>
> /opt/solr-5.3.0/bin/solr status
>
> Found 1 Solr nodes:
>
> Solr process 31114 running on port 8983
>
> ERROR: Failed to get system information from http://localhost:8983/solr
> due
> to: org.apache.http.client.ClientProtocolException: Expected JSON response
> from server but received: <html>
>
> <head>
>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
>
> <title>Error 401 Unauthorized</title>
>
> </head>
>
> <body><h2>HTTP ERROR 401</h2>
>
> <p>Problem accessing /solr/admin/info/system. Reason:
>
> <pre>    Unauthorized</pre></p><hr><i><small>Powered by
> Jetty://</small></i><hr/>
>
>
> </body>
>
> </html>
>