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.

There are several things defined in this file:<br />

Caveats<br />

Basic authentication and rule-based authorization plugins are enabled.<br />

A user called 'solr', with a password '<strong>Solr</strong>Rocks' has been defined.<br />

'blockUknown:true' means that unauthenticated requests are not allowed to pass through<br />

The 'admin' role has been defined, and it has permission to edit security settings.<br />

The 'solr' user has been defined to the 'admin' role.<br />

There are a few things to keep in mind when using the Basic authentication plugin.<br />

Credentials are sent in plain text by default. It's recommended to use SSL for communication when Basic<br />

authentication is enabled, as described in the section Enabling SSL.<br />

A user who has access to write permissions to security.json will be able to modify all the permissions<br />

and how users have been assigned permissions. Special care should be taken to only grant access to<br />

editing security to appropriate users.<br />

Your network should, of course, be secure. Even with Basic authentication enabled, you should not<br />

unnecessarily expose <strong>Solr</strong> to the outside world.<br />

Editing Authentication Plugin Configuration<br />

An Authentication API allows modifying user IDs and passwords. The API provides an endpoint with specific<br />

commands to set user details or delete a user.<br />

API Entry Point<br />

admin/authentication<br />

This endpoint is not collection-specific, so users are created for the entire <strong>Solr</strong> cluster. If users need to be<br />

restricted to a specific collection, that can be done with the authorization rules.<br />

Add a User or Edit a Password<br />

The set-user command allows you to add users and change their passwords. For example, the following<br />

defines two users and their passwords:<br />

curl --user solr:<strong>Solr</strong>Rocks http://localhost:8983/solr/admin/authentication -H<br />

'Content-type:application/json' -d '{<br />

"set-user": {"tom" : "TomIsCool" ,<br />

"harry":"HarrysSecret"}}'<br />

Delete a User<br />

The delete-user command allows you to remove a user. The user password does not need to be sent to<br />

remove a user. In the following example, we've asked that user IDs 'tom' and 'harry' be removed from the<br />

system.<br />

curl --user solr:<strong>Solr</strong>Rocks http://localhost:8983/solr/admin/authentication -H<br />

'Content-type:application/json' -d '{<br />

"delete-user": ["tom","harry"]}'<br />

Set a property<br />

Set arbitrary properties for authentication plugin. The only supported property is 'blockUnknown'<br />

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

514

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

Saved successfully!

Ooh no, something went wrong!