Unable to connect to index when Solr authentication and authorization
- vishnusvParticipant3 years, 8 months ago #18569
I am unable to complete “step 0 – Connect your indexes” if I have Solr authentication and authorization plugins are enabled. Error displayed on the screen says “cURL error 7:” When I provide wrong credentials, it clearly report bad credentials error.
Everything works fine when I disable Solr authentication and authorization.
vishnusvParticipant3 years, 8 months ago #18596Error message given in WordPress admin is just “cURL error 7:”. Is there any log file where I can get detailed error messages ?
I have created security.json file and uses solr.BasicAuthPlugin and solr.RuleBasedAuthorizationPlugin. Solr runs on http (not https). I can login into solr admin using the credentials configured in security.json
vishnusvParticipant3 years, 8 months ago #18600Yes, when basic auth is disabled or “blockUnknown” set to false in security.json, it works fine. Besides, if I gave bad credentials, it clearly shows error message saying “Bad Credentials”. So I think there is no issue reaching Solr. btw, we are on Solr 8.4.1.
wpsolrKeymaster3 years, 8 months ago #18602My tests are fine with WPSOLR PRO 21.8, Solr 8.4.1, and Solr basic auth as described in https://javadeveloperzone.com/solr/securing-solr-setup-basic-authentication/
vagrant@vvv:~/solr-8.4.1/server/solr$ ls -l
total 32
drwxr-xr-x 5 vagrant vagrant 4096 Mar 12 16:58 configsets
drwxrwxr-x 2 vagrant vagrant 4096 Mar 12 16:52 filestore
-rw-r–r– 1 vagrant vagrant 3018 Jan 10 07:50 README.txt
-rw-rw-r– 1 vagrant vagrant 370 Mar 12 16:53 security.json
drwxrwxr-x 3 vagrant vagrant 4096 Mar 12 16:58 solr
-rw-r–r– 1 vagrant vagrant 2253 Jan 10 07:50 solr.xml
drwxrwxr-x 2 vagrant vagrant 4096 Mar 12 16:52 userfiles
-rw-r–r– 1 vagrant vagrant 1048 Jan 10 07:50 zoo.cfgcontent of security.json (solr:SolrRocks):
{
“authentication”:{
“blockUnknown”: true,
“class”:”solr.BasicAuthPlugin”,
“credentials”:{“solr”:”IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c=”}
},
“authorization”:{
“class”:”solr.RuleBasedAuthorizationPlugin”,
“permissions”:[{“name”:”security-edit”,
“role”:”admin”}],
“user-role”:{“solr”:”admin”}
}}1) As expected: I could not connect without the user/pwd
2) As expected: I could create my index from WPSOLR, then index my documents, with the user/pwd
vishnusvParticipant3 years, 8 months ago #18611Looks like the issue is with passwords having # character. I reset my password to remove the # char and it is working now.
Try adding a # to Your password
curl –user solr:SolrRocks https://localhost:8983/solr/admin/authentication -H ‘Content-type:application/json’ -d ‘{“set-user”: {“solr” : “SolrRocks@123#”}}’
You must be logged in to reply to this topic.