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

Kevin Risden commented on SOLR-8213:
------------------------------------

For reference here is the block to enable basic auth username solr and password 
SolrRocks and have read authorization. I tested this block with JdbcTest, 
StreamingTest, and StreamExpressionTest. It should work with any test that 
extends AbstractFullDistribZkTestBase I think.

{code}
  @Override
  public void distribSetUp() throws Exception {
    super.distribSetUp();

    // Sets up basic auth with user solr and password SolrRocks
    // Enables read permissions for solr user
    try (ZkStateReader zkStateReader = new 
ZkStateReader(zkServer.getZkAddress(),
        DEFAULT_CONNECTION_TIMEOUT, DEFAULT_CONNECTION_TIMEOUT)) {
      zkStateReader.getZkClient().create(ZkStateReader.SOLR_SECURITY_CONF_PATH,
          ("{\n" +
              "  \"authentication\":{\n" +
              "    \"class\":\"solr.BasicAuthPlugin\",\n" +
              "    \"credentials\":{\n" +
              "      \"solr\":\"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= 
Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c=\"},\n" +
              "    \"\":{\"v\":1}},\n" +
              "  \"authorization\":{\n" +
              "    \"class\":\"solr.RuleBasedAuthorizationPlugin\",\n" +
              "    \"permissions\":[\n" +
              "      {\n" +
              "        \"name\":\"read\",\n" +
              "        \"role\":[\"admin\"]}],\n" +
              "    
\"user-role\":{\"solr\":\"admin\"}}}").getBytes(Charsets.UTF_8),
          CreateMode.PERSISTENT, true);
    }
  }
{code}

> SolrJ JDBC support authentication
> ---------------------------------
>
>                 Key: SOLR-8213
>                 URL: https://issues.apache.org/jira/browse/SOLR-8213
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrJ
>    Affects Versions: master
>            Reporter: Kevin Risden
>
> SolrJ JDBC doesn't support authentication where as Solr supports Basic and 
> Kerberos authentication currently. 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to