0

Github Link

Missing username and password properties from the solr connector configuration to authenticate with the solr.

Is that possible to authenticate with solr via connector config?

How to pass username n password within the connector config?

James Z
  • 12,209
  • 10
  • 24
  • 44
Rabeesh
  • 31
  • 9
  • Have you tried including the `user:pass` combination in the URL as you'd do with a regular http url including username and password? (`http://username:password@host/..`) – MatsLindh Jun 25 '21 at 09:37
  • Yes I have Tried it but still getting same issue. – Rabeesh Jun 25 '21 at 11:04
  • According to the source it seems you can use `solr.username` and `solr.password` to provide authentication details. https://github.com/bkatwal/kafka-solr-sink-connector/blob/f0d022607f3d5419053bfb0c87a710fb37e00896/src/main/java/com/bkatwal/kafkaproject/SolrSinkConnectorConfig.java#L37 – MatsLindh Jun 25 '21 at 11:25
  • Yes I Have Checked it n it gives me error like Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://IP:PORT/solr: Expected mime type Error 401 require authentication

    HTTP ERROR 401 require authentication

    URI:/solr/FX_TRAN/update
    STATUS:401
    MESSAGE:require authentication
    SERVLET:default
    – Rabeesh Jun 26 '21 at 05:43

1 Answers1

0

Looks like solr.username and solr.password aren't actually used in the connector. The SolrClient is created with a default HttpSolrClient without any credentials in this source file in Github. But MatsLindh's point about embedding username and password in the URL is a good one and I'd have expected it to work.

There's a relevant thread here:

Solr6.3.0 SolrJ API for Basic Authentication

I haven't vetted the last answer in the thread, which doesn't really address the original topic in that post, but it is a concise example of creating a SolrClient with authentication. The SolrClient needs to wrap an underlying HttpClient that provides the basic auth, and the Kafka Solr sink connector isn't doing that.

Eric Schoen
  • 668
  • 9
  • 16