lucidworks / spark-solr

Tools for reading data from Solr as a Spark RDD and indexing objects from Spark into Solr using SolrJ.
Apache License 2.0
446 stars 250 forks source link

Support for BasicAuthentication with jks certificate enabled #327

Open Kund08 opened 3 years ago

Kund08 commented 3 years ago

I can see we have support for basic authentication in spark-solr with -Dbasicauth=solr:SolrRocks option set in executor and driver java args. our solr has got basic authentication enabled with certificate. The process we follow to connect to this solr instance using solrJ client is by setting: spark.executor.extraJavaOptions=-Djavax.net.ssl.trustStoreType=jks -Djavax.net.ssl.trustStore=clientTrustStore.jks -Djavax.net.ssl.trustStorePassword=password

and

spark.driver.extraJavaOptions=-Djavax.net.ssl.trustStoreType=jks -Djavax.net.ssl.trustStore=clientTrustStore.jks -Djavax.net.ssl.trustStorePassword=password

and setting userName and password while creating solrClient Object in code. This way we are able to connect via solrJ.

Now while connecting to this solr instance using spark-solr, we do not have option to add userName and password via code, so we pass one extra argument -Dbasicauth=solr:SolrRocks in spark.driver.extraJavaOptions and spark.executor.extraJavaOptions. But doing this is not working and we are getting Error 403 Unauthorized request, Response code: 403 while doing dateFrame.write.format("solr").

Can we get some help on this.

eswara-prasad-tm commented 3 years ago

Can you give little more detail about the Spark Version, Solr Version?. You are connecting to Zookeeper/Solr Endpoint?