You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Anchal Sharma2 <an...@in.ibm.com> on 2022/07/01 04:04:20 UTC

Problem in enabling basic solr authentication for solr cluster

Hello Team ,

I referred to following link and enabled basic solr authentication  -
Basic Authentication Plugin | Apache Solr Reference Guide 8.11<https://solr.apache.org/guide/8_11/basic-authentication-plugin.html >
Basic Authentication Plugin | Apache Solr Reference Guide 8.11<https://solr.apache.org/guide/8_11/basic-authentication-plugin.html >
Combining Basic Authentication with Other Schemes. When using other authentication schemes, such as the JWT Authentication Plugin, you may still want to use Basic authentication for a small set of "service account" oriented client applications.Solr provides the MultiAuthPlugin to support multiple authentication schemes. For example, you may want to integrate Solr with an OIDC provider for user ...
solr.apache.org

 It works well for a standalone solrcloud . But when I try these steps in solr cluster (3 zookeepers and 2 solrs) . I get intermittent error on running query on solr collections . Please let me know if I have missed some configuration. Please note the error comes ONLY when running query , and I can login to solr just fine using solr credentials.
Solr version 8.11.1 and apache zookeeper version 3.5.8

ERROR

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 401 require authentication</title>
</head>
<body><h2>HTTP ERROR 401 require authentication</h2>
<table>
<tr><th>URI:</th><td>/solr/param/select</td></tr>
<tr><th>STATUS:</th><td>401</td></tr>
<tr><th>MESSAGE:</th><td>require authentication</td></tr>
<tr><th>SERVLET:</th><td>default</td></tr>
</table>

</body>
</html>

STEPS DONE
1.Updated security.json on both solr nodes
{"authentication":{
"blockUnknown": true,
"class":"solr.BasicAuthPlugin",
"credentials":{"solr":"DefaultEncryptedPassword"},
"realm":"Solr user",
"forwardCredentials": false},
"authorization":{"class":"solr.RuleBasedAuthorizationPlugin",
"user-role":{"solr":"admin"},
"permissions":[{"name":"security-edit","role":"admin"}]
}}

2.Restarted all 3 zookeeper and 2 solr nodes

3.Upload security.json to zookeeper (for both solr nodes)
./solr zk cp /<local path to>/security.json zk:security.json -z hostname1:2181,hostname2:2181,hostname3:2181

Thank You
Anchal Sharma