11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

in/solr -c -z server1:2181,server2:2181,server3:2181/solr<br />

Test the Configuration<br />

1.<br />

2.<br />

Do a kinit with your username. For example, "kinit user@EXAMPLE.COM"<br />

Try to access <strong>Solr</strong> using curl. You should get a successful response.<br />

curl --negotiate -u : "http://192.168.0.107:8983/solr/"<br />

Using <strong>Solr</strong>J with a Kerberized <strong>Solr</strong><br />

To use Kerberos authentication in a <strong>Solr</strong>J application, you need the following two lines before you create a<br />

<strong>Solr</strong>Client:<br />

System.setProperty("java.security.auth.login.config", "/home/foo/jaas-client.conf");<br />

HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());<br />

You need to specify a Kerberos service principal for the client and a corresponding keytab in the JAAS client<br />

configuration file above. This principal should be different from the service principal we created for <strong>Solr</strong> .<br />

Here’s an example:<br />

<strong>Solr</strong>JClient {<br />

com.sun.security.auth.module.Krb5LoginModule required<br />

useKeyTab=true<br />

keyTab="/keytabs/foo.keytab"<br />

storeKey=true<br />

useTicketCache=true<br />

debug=true<br />

principal="solrclient@EXAMPLE.COM";<br />

};<br />

Rule-Based Authorization Plugin<br />

<strong>Solr</strong> allows configuring roles to control user access to the system. This is accomplished through rule-based<br />

permission definitions which are assigned to users. The roles are fully customizable, and provide the ability to<br />

limit access to specific collections, request handlers, request parameters, and request methods.<br />

The roles can be used with any of the authentication plugins or with a custom authentication plugin if you have<br />

created one. You will only need to ensure that you configure the role-to-user mappings with the proper user IDs<br />

that your authentication system provides.<br />

Once defined through the API, roles are stored in security.json in ZooKeeper. This means this feature is<br />

available when using <strong>Solr</strong> in <strong>Solr</strong>Cloud mode only.<br />

Enable the Authorization Plugin<br />

The plugin must be enabled in security.json. This file and how to upload it to ZooKeeper is described in<br />

detail in the section Enable Plugins with security.json.<br />

This file has two parts, the authentication part and the authorization part. The authentication part<br />

stores information about the class being used for authentication.<br />

The authorization part is not related to Basic authentication, but is a separate authorization plugin designed<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

521

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!