Skip to content

Instantly share code, notes, and snippets.

@shawnfeldman
Created June 2, 2017 18:42
Show Gist options
  • Select an option

  • Save shawnfeldman/2cfb45b87cd301dec3edcf8840e878f5 to your computer and use it in GitHub Desktop.

Select an option

Save shawnfeldman/2cfb45b87cd301dec3edcf8840e878f5 to your computer and use it in GitHub Desktop.
solr basic auth
/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost $ZK -cmd put /security.json '{"authentication": {"class": "solr.BasicAuthPlugin","blockUnknown": false,"credentials": {"solr": "J0IbXqNMOsK6fvu3EseKuMiBiXAeRo51a6OoJBEbPEU= yLhT0cqEvO7CCkBUEZSDBQgTT/50CbfW0WjjC2YZchc="}},"authorization": {"class": "solr.RuleBasedAuthorizationPlugin","permissions": [{"name": "security-edit","role": "admin"}],"user-role": {"solr": "admin"}}}'
sleep 5
curl --insecure -v http://solr:admin@localhost:8983/solr/admin/authentication -H 'Content-type:application/json' -d "{ 'set-user': {'$SOLRUSER': '$SOLRPASSWORD'}}"
sleep 5
curl --insecure -v http://$SOLRUSER:$SOLRPASSWORD@localhost:8983/solr/admin/authentication -H 'Content-type:application/json' -d "{'set-property': {'blockUnknown':true}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment