3

It is possible to connect 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.

MPelletier
  • 16,256
  • 15
  • 86
  • 137
bobosh
  • 425
  • 5
  • 21

2 Answers2

1

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);
dthrasher
  • 40,656
  • 34
  • 113
  • 139
Amit Sharma
  • 133
  • 8
0

Implement a IHttpWebRequestFactory that returns an authenticated web request. See http://code.google.com/p/solrnet/issues/detail?id=66

Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275