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.

Authentication<br />

Authentication plugins help in securing the endpoints of <strong>Solr</strong> by authenticating incoming requests. A custom<br />

plugin can be implemented by extending the AuthenticationPlugin class.<br />

An authentication plugin consists of two parts:<br />

1. Server-side component, which intercepts and authenticates incoming requests to <strong>Solr</strong> using a mechanism<br />

defined in the plugin, such as Kerberos, Basic Auth or others.<br />

2. Client-side component, i.e., an extension of HttpClientConfigurer, which enables a <strong>Solr</strong>J client to<br />

make requests to a secure <strong>Solr</strong> instance using the authentication mechanism which the server<br />

understands.<br />

Enabling a Plugin<br />

Specify the authentication plugin in /security.json as in this example:<br />

security.json<br />

{<br />

}<br />

"authentication": {<br />

"class": "class.that.implements.authentication",<br />

"other_data" : "..."}<br />

All of the content in the authentication block of security.json would be passed on as a map to the<br />

plugin during initialization.<br />

An authentication plugin can also be used with a standalone <strong>Solr</strong> instance by passing in -Dauthenticat<br />

ionPlugin= during the startup.<br />

Available Authentication Plugins<br />

<strong>Solr</strong> has two implementations of authentication plugins:<br />

Kerberos Authentication Plugin<br />

Basic Authentication Plugin<br />

Authorization<br />

An authorization plugin can be written for <strong>Solr</strong> by extending the AuthorizationPlugin interface.<br />

Loading a Custom Plugin<br />

Make sure that the plug-in implementation is in the classpath.<br />

The plugin can then be initialized by specifying the same in security.json in the following manner:<br />

security.json<br />

{<br />

}<br />

"authorization": {<br />

"class": "org.apache.solr.security.MockAuthorizationPlugin",<br />

"other_data" : "..."}<br />

All of the content in the authorization block of security.json would be passed on as a map to the plugin<br />

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

512

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

Saved successfully!

Ooh no, something went wrong!