[ 
https://issues.apache.org/jira/browse/KNOX-528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14521913#comment-14521913
 ] 

Rick Kellogg commented on KNOX-528:
-----------------------------------

Another option would be using preemptive authentication with 
CommonsHttpSolrServer similar to the following:

 String USERNAME = "x";
 String PASSWORD = "x";
 String HOSTNAME = "x";
 String ROUTEID = "x";
 CommonsHttpSolrServer server = new CommonsHttpSolrServer("http://"; + USERNAME 
+ ":" + PASSWORD + "@" + HOSTNAME + "/" + ROUTEID + "/solr/collection1");
 Credentials defaultcreds = new UsernamePasswordCredentials(USERNAME, PASSWORD);
 server.getHttpClient().getState().setCredentials(new AuthScope(HOSTNAME, 80, 
AuthScope.ANY_REALM), defaultcreds);
 server.getHttpClient().getParams().setAuthenticationPreemptive(true);

This might be the best option and not require any changes to the SOLRJ baseline.

> Support for Apache SOLR REST APIs
> ---------------------------------
>
>                 Key: KNOX-528
>                 URL: https://issues.apache.org/jira/browse/KNOX-528
>             Project: Apache Knox
>          Issue Type: Improvement
>            Reporter: Rick Kellogg
>             Fix For: 0.7.0
>
>
> Add Knox support for routing and securing Apache SOLR's REST APIs
> See: https://wiki.apache.org/solr/Solrj



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

Reply via email to