On Fri, Mar 13, 2009 at 12:03 AM, Narayanan, Karthikeyan <
karthikeyan.naraya...@gs.com> wrote:

> Hi,
>      We have installed the Solr in Tomcat server and enabled the
> security constraint at the Tomcat level.. We require to pass the
> authentication token(cookie) to the search call that is made using
> CommonsHttpSolrServer. Would like to know how can I add  the token to
> the CommonsHttpSolrServer. Appreciate any idea on this.
>

I took a look at commons-httpclient javadocs. This should work:

Create an instance of HttpState and use the HttpState#addCookie to add your
auth cookie. Then you can create an instance of HttpClient and use
HttpClient#setState method to pass the HttpState object. Finally pass this
HttpClient object to the constructor of CommonsHttpSolrServer.

-- 
Regards,
Shalin Shekhar Mangar.

Reply via email to