Using BasicAuth with SolrJ
In SolrJ, the basic authentication credentials need to be set for each request as in this example:
SolrRequest req ;//create a new request object req.setBasicAuthCredentials(userName, password); solrClient.request(req);
Query example:
QueryRequest req = new QueryRequest(new SolrQuery("*:*")); req.setBasicAuthCredentials(userName, password); QueryResponse rsp = req.process(solrClient);