I had seen where I could pass in an HttpClient to the SolrServer. The problem is that the HttpClient only receives the authentication information through the execute method using the context. See the example located here.
https://hc.apache.org/httpcomponents-client-4.3.x/tutorial/html/authentication.html DefaultHttpClient has methods to set the authentication information but the class is deprecated. Thanks. On Mon, Nov 17, 2014 at 11:35 AM, Fuad Efendi <f...@efendi.ca> wrote: > > I can > > manually create an httpclient and set up authentication but then I can't > use solrj. > > Yes; correct; except that you _can_ use solj with this custom HttpClient > instance (which will intercept authentication, which will support cookies, > SSL or plain HTTP, Keep-Alive, and etc.) > > You can provide to SolrJ custom HttpClient at construction: > > final HttpSolrServer myHttpSolrServer = > new HttpSolrServer( > SOLR_URL_BASE + "/" + SOLR_CORE_NAME, > myHttpClient); > > > Best Regards, > > http://www.tokenizer.ca > > > -----Original Message----- > From: Anurag Sharma [mailto:anura...@gmail.com] > Sent: November-17-14 11:21 AM > To: solr-user@lucene.apache.org > Subject: Re: Solr HTTP client authentication > > I think Solr encourage SSL than authentication > > On Mon, Nov 17, 2014 at 6:08 PM, Bai Shen <baishen.li...@gmail.com> wrote: > > > I am using solrj to connect to my solr server. However I need to > > authenticate against the server and can not find out how to do so > > using solrj. Is this possible or do I need to drop solrj? I can > > manually create an httpclient and set up authentication but then I can't > use solrj. > > > > Thanks. > > > >