Andrew Fletcher published: 18 January 2022 1 minute read
Adding basic security to your server, requires altering the security.json file. For me this file was located
/var/solr/data/
Add a User or Edit a Password
The set-user command allows you to add users and change their passwords. For example, the following defines two users and their passwords:
curl --user solr:SolrRocks http://localhost:8983/api/cluster/security/authentication -H 'Content-type:application/json' -d '{"set-user": {"andrew":"andrewsPass"}}'
Delete a User
The delete-user command allows you to remove a user. The user password does not need to be sent to remove a user. In the following example, we’ve asked that user IDs 'andrew' and 'harry' be removed from the system.
curl --user solr:SolrRocks http://localhost:8983/api/cluster/security/authentication -H 'Content-type:application/json' -d '{"delete-user": ["andrew"]}'
Set a Property
Set properties for the authentication plugin. The currently supported properties for the Basic Authentication plugin are blockUnknown, realm and forwardCredentials.
curl --user solr:SolrRocks http://localhost:8983/api/cluster/security/authentication -H 'Content-type:application/json' -d '{"set-property": {"blockUnknown":false}}'
Success response
A successful response will look like
{
"responseHeader": {
"status":0,
"QTime":4}}