lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Høydahl (JIRA) <j...@apache.org>
Subject [jira] [Closed] (SOLR-10530) Basic Authentication Plugin blockUnknown HTTP ERROR 401 require authentication
Date Mon, 24 Apr 2017 06:56:04 GMT

     [ https://issues.apache.org/jira/browse/SOLR-10530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jan Høydahl closed SOLR-10530.
------------------------------
    Resolution: Duplicate

I was hoping that it could hit another code path and work, but obviously not.

Closing this as duplicate of SOLR-9399. That issue also has a PR which solves the problem,
perhaps you could try that? Please followup with discussion and problem resolution there.

> Basic Authentication Plugin blockUnknown HTTP ERROR 401 require authentication
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-10530
>                 URL: https://issues.apache.org/jira/browse/SOLR-10530
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: 6.4.2
>         Environment: linux  and mac os
>            Reporter: wangyongxin
>         Attachments: screenshot-1.png
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> when solr cloud use Basic Authentication Plugin, and set blockUnknown = true, set username
and password in security.json and solr.in.sh,  and my solr version is 6.4.2, and i created
a collection named "news", changed managed-schema and solrconfig.xml in zookeeper cloud, and
add a jar named ik-analyzer.jar into solr webapp lib directory, restart solr clouds, everything
seems ok, and I use my java web project connected to zookeepers, use codes method like :
> public static QueryResponse getResponseWithAuth(CloudSolrClient solr, SolrQuery query)
throws SolrServerException, IOException {
>         QueryRequest req = new QueryRequest(query);
>         req.setBasicAuthCredentials(username, password);
>         return req.process(solr);
>     }
> search in solr with base authentication is working right ! but when I trying to delete
or update documents with solr like this:
> public static UpdateResponse deleteWithAuth(CloudSolrClient solr, String id) throws SolrServerException,
IOException {
>         UpdateRequest updateRequest = new UpdateRequest();
>         updateRequest.setBasicAuthCredentials(username, password);
>         updateRequest.setAction(UpdateRequest.ACTION.COMMIT, false, false);
>         updateRequest.deleteById(id);
>         return updateRequest.process(solr);
>     }
> or update method :
> public static UpdateResponse addWithAuth(CloudSolrClient solr, SolrInputDocument doc)
throws SolrServerException, IOException {
>         UpdateRequest updateRequest = new UpdateRequest();
>         updateRequest.setBasicAuthCredentials(username, password);
>         updateRequest.setAction(UpdateRequest.ACTION.OPTIMIZE, false, false);
>         updateRequest.add(doc);
>         return updateRequest.process(solr);
>     }
>  it returns error like this :
> 11:20:42.450 [http-bio-8060-exec-10] ERROR o.a.s.c.s.i.CloudSolrClient - Request to collection
news failed due to (401) org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:
Error from server at http://192.168.10.250:8983/solr/news_shard1_replica1: Expected mime type
application/xml but got text/html. <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
> <title>Error 401 require authentication</title>
> </head>
> <body><h2>HTTP ERROR 401</h2>
> <p>Problem accessing /solr/news_shard1_replica1/update. Reason:
> <pre>    require authentication</pre></p>
> </body>
> </html>
> , retry? 0
> please help me find out where I am wrong ! thanks



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message