You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Narayanan, Karthikeyan" <Ka...@gs.com> on 2009/03/12 19:33:28 UTC

Adding authentication Token to the CommonsHttpSolrServer

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.

Thanks.
Karthik



Re: Adding authentication Token to the CommonsHttpSolrServer

Posted by Otis Gospodnetic <ot...@yahoo.com>.
You should be able to pass any custom URL parameters using ModifiableSolrParams class.


Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: "Narayanan, Karthikeyan" <Ka...@gs.com>
> To: solr-user@lucene.apache.org
> Sent: Thursday, March 12, 2009 2:33:28 PM
> Subject: Adding authentication Token to the CommonsHttpSolrServer
> 
> 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.
> 
> Thanks.
> Karthik


Re: Adding authentication Token to the CommonsHttpSolrServer

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Mar 13, 2009 at 12:03 AM, Narayanan, Karthikeyan <
Karthikeyan.Narayanan@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.