Hi,

I am trying to connect with authenticated solr instance. I have added latest
solrnet .dll  but getting authentication issue. Please Suggest me where i
did wrong.

    ISolrOperations<SolrProductCorecl> oSolrOperations = null;
    const string core0url = "http://localhost:8080/solr/products";;
    const string core1url = "http://localhost:8080/solr/products";;
    var solrFacility = new SolrNetFacility(core0url);
    var container = new WindsorContainer();
    container.AddFacility("solr", solrFacility);
    BasicAuthHttpWebRequestFactory OAuth = new
BasicAuthHttpWebRequestFactory("djsrNPvHsUnBSETg", "x");
    // override core1 components
    const string core1Connection = "core1.connection";
   
container.Register(Component.For<ISolrConnection>().ImplementedBy<SolrConnection>().Named(core1Connection).Parameters(Castle.MicroKernel.Registration.Parameter.ForKey("serverURL").Eq(core1url)));

   
container.Register(Component.For(typeof(ISolrBasicOperations<SolrProductCorecl>),
typeof(ISolrBasicReadOnlyOperations<SolrProductCorecl>))
                          
.ImplementedBy<SolrBasicServer&lt;SolrProductCorecl>>()
                          
.ServiceOverrides(ServiceOverride.ForKey("connection").Eq(core1Connection)));

   
container.Register(Component.For(typeof(ISolrOperations<SolrProductCorecl>),
typeof(ISolrReadOnlyOperations<SolrProductCorecl>))
                          
.ImplementedBy<SolrServer&lt;SolrProductCorecl>>()
                          
.ServiceOverrides(ServiceOverride.ForKey("connection").Eq(core1Connection)));

   
container.Register(Component.For<ISolrQueryExecuter&lt;SolrProductCorecl>>().ImplementedBy<SolrQueryExecuter&lt;SolrProductCorecl>>()
                          
.ServiceOverrides(ServiceOverride.ForKey("connection").Eq(core1Connection)));

    //Authentication//
   
container.Register(Component.For<IHttpWebRequestFactory>().ImplementedBy<BasicAuthHttpWebRequestFactory>().ServiceOverrides(ServiceOverride.ForKey("connection").Eq("")));
    
    oSolrOperations =
container.Resolve<ISolrOperations&lt;SolrProductCorecl>>();
    oSolrOperations.Ping();



-----
Regards,

Suneel Pandey
Sr. Software Developer
--
View this message in context: 
http://lucene.472066.n3.nabble.com/Authentication-Not-working-in-solrnet-getting-401-error-tp4007254.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to