You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Susheel Kumar (JIRA)" <ji...@apache.org> on 2016/08/02 13:05:20 UTC

[jira] [Created] (SOLR-9370) Add sample code snippet to confluence documentaion for Basic Authentication

Susheel Kumar created SOLR-9370:
-----------------------------------

             Summary: Add sample code snippet to confluence documentaion for Basic Authentication
                 Key: SOLR-9370
                 URL: https://issues.apache.org/jira/browse/SOLR-9370
             Project: Solr
          Issue Type: Task
      Security Level: Public (Default Security Level. Issues are Public)
          Components: documentation
            Reporter: Susheel Kumar
            Priority: Minor


Please add below code snippet to under "Using BasicAuth with SolrJ"  as current code "snippet" doesn't give visibility on how basic authentication can be set when querying


How to set credentials when querying using SolrJ - Basic Authentication
=========

SolrQuery query = new SolrQuery();
query.setQuery("*:*");
// Do any other query setup needed.

SolrRequest<QueryResponse> req = new QueryRequest(query);
req.setBasicAuthCredentials(userName, password); 

QueryResponse rsp = req.process(solrClient, collection);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org