Unable to connect to index when Solr authentication and authorization

  • vishnusv
    Participant
    4 years, 1 month 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.

    wpsolr
    Keymaster
    4 years, 1 month ago #18570

    What is the full error message?

    And how do you protect your Solr?

    vishnusv
    Participant
    4 years, 1 month ago #18596

    Error 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

    wpsolr
    Keymaster
    wpsolr
    Keymaster
    4 years, 1 month ago #18598

    Can you connect if you deactivate Solr Basic Auth?

    vishnusv
    Participant
    4 years, 1 month ago #18600

    Yes, 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.

    wpsolr
    Keymaster
    4 years, 1 month ago #18601

    Is it for Solr or SolrCloud?

    wpsolr
    Keymaster
    4 years, 1 month ago #18602

    My 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.cfg

    content 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
    Image solr-basic-auth-denied.png of

    2) As expected: I could create my index from WPSOLR, then index my documents, with the user/pwd

    Image solr-basic-auth-accepted.png of

    vishnusv
    Participant
    4 years, 1 month ago #18611

    Looks 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#”}}’

    wpsolr
    Keymaster
    4 years, 1 month ago #18612

    Good.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.