It is possible to conne开发者_高级运维ct solr instance with basic authentication ?
I have tried with :
Startup.Init<Page>("http://user:mdp@localhost:8080/solr");
But it doesn't work.
have you got a solution ?
Thanks.
Try this
string solrUser = "user"; // replace with your credentials
string solrPwd = "mdp"; // replace with your credentials
var connection = new SolrConnection("http://localhost:8080/solr")
{
HttpWebRequestFactory = new HttpWebAdapters.BasicAuthHttpWebRequestFactory(solrUser, solrPwd)
};
Startup.Init<Page>(connection);
Implement a IHttpWebRequestFactory
that returns an authenticated web request. See http://code.google.com/p/solrnet/issues/detail?id=66
精彩评论