lee
lee

Reputation: 234

adding basic authentication to Solr 8.6.1

We are having some difficulty when adding basic authentication to Solr 8.6.1. We are following this document, and we have created security.json file, which is successful (since Solr instance will ask userId and password when it starts.) Our difficulty happens when trying to enable the global authentication settings: we did pass the -Dsolr.httpclient.builder.factory=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory system property,and we also set the -Dbasicauth=username:password property as follows:

// the following is the last time of our Solr Dockerfile:
CMD ["solr-foreground", "-Dsolr.httpclient.builder.factory=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory", "-Dbasicauth=username:secret"]

However, the calls to retrieve data from Solr all come back with Error 401 require authentication.

Could someone please kindly let us know what did we miss?

Upvotes: 0

Views: 761

Answers (1)

MatsLindh
MatsLindh

Reputation: 52912

You'll have to set the correct options on the client - not on the server. This is a setting that affects how the client that connects to Solr authenticates.

So when running your application, give the parameter to the java command (or configure it to be the default parameter through ant/maven/gradle/etc.

Setting it on the docker container will not do anything useful.

Upvotes: 1

Related Questions