4

I working on the Apache solr (version 8) authentication, using basic authentication API. Using below security.json and placed in the $Solr_Home(/opt/solr/server). But still i am not getting authentication popup when I open the solr site

  {
    "authentication":{
       "blockUnknown": true,
       "class":"solr.BasicAuthPlugin",
       "credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVB
AaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="},
       "realm":"My Solr users",
       "forwardCredentials": false
      },

 "authorization":{
     "class":"solr.RuleBasedAuthorizationPlugin",
     "permissions":[{"name":"security-edit","role":"admin"}],
      "user-role":{"solr":"admin"}
       }}
Girija S
  • 141
  • 1
  • 11
  • Hi please help me to fix this issue – Girija S Nov 20 '19 at 06:24
  • Are you running your solr in cloud mode? – cheffe Nov 20 '19 at 07:48
  • it is working fine. I kept the seurity.json in the proper folder /var/solr/data. – Girija S Nov 22 '19 at 09:42
  • That does not answer my question. If you run in cloud mode, placing a file somewhere does not do anything. You need to upload the file into ZooKeeper who then in turn will propagate them across the cluster. – cheffe Nov 22 '19 at 12:19
  • 1
    I am using standalone not cloud. so placed in proper location, it is fine. – Girija S Nov 26 '19 at 08:41
  • /var/solr/data/ is the wrong place for the security.json. It needs to be placed alongside the solr.xml, usually in /opt/solr/ or /opt/solr/server/ – cheffe Nov 26 '19 at 14:40

1 Answers1

4

You should place the file in /var/solr/data/ or where ever solr.xml is. and make sure the file name is security.json. Otherwise, Apache Solr won't recognize the file.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
ashkar
  • 41
  • 2
  • The Documentation is not really well in that point where you have to set configurations. But when you copy the file in the data folder it's working and the solr.xml is not located in that folder. – René Höhle Dec 16 '22 at 13:59