Cannot config Authorization and Authentication in Solr 9.5 Standalone

I am trying out Solr 9.5 for the first time. I have installed Solr on my MacBook and can start it without any issues. The second step involves setting up Authorization and Authentication, which does not work when I follow the instructions.

The instructions for starting Solr in standalone mode (not cloud) involve creating a file named security.json, and adding the following to that file where solr.xml is /opt/solr-9.5.0/server/solr:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>{
"authentication": {
"blockUnknown": true,
"class": "solr.BasicAuthPlugin",
"credentials": {
"solr": "ymoqYYPJM0dyovJW0V/Sf6jNSD6ffYVjHcoR0skpcCU=:I5HY9Lf2RFAQi1/LJaFx4w=="
},
"realm": "My Solr users",
"forwardCredentials": false
},
"authorization": {
"class": "solr.RuleBasedAuthorizationPlugin",
"permissions": [
{
"name": "security-edit",
"role": "admin"
}
],
"user-role": {
"solr": "admin"
}
}
</code>
<code>{ "authentication": { "blockUnknown": true, "class": "solr.BasicAuthPlugin", "credentials": { "solr": "ymoqYYPJM0dyovJW0V/Sf6jNSD6ffYVjHcoR0skpcCU=:I5HY9Lf2RFAQi1/LJaFx4w==" }, "realm": "My Solr users", "forwardCredentials": false }, "authorization": { "class": "solr.RuleBasedAuthorizationPlugin", "permissions": [ { "name": "security-edit", "role": "admin" } ], "user-role": { "solr": "admin" } } </code>
{
"authentication": {
    "blockUnknown": true,
    "class": "solr.BasicAuthPlugin",
    "credentials": {
        "solr": "ymoqYYPJM0dyovJW0V/Sf6jNSD6ffYVjHcoR0skpcCU=:I5HY9Lf2RFAQi1/LJaFx4w=="
    },
    "realm": "My Solr users",
    "forwardCredentials": false
},
"authorization": {
    "class": "solr.RuleBasedAuthorizationPlugin",
    "permissions": [
        {
            "name": "security-edit",
            "role": "admin"
        }
    ],
    "user-role": {
        "solr": "admin"
    }
}

}

The username is “solr,” and the password is SHA256 hashed and salted using the following Python code:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>import hashlib
import os
import base64
def generate_sha256_hash_and_salt(password):
salt = os.urandom(16)
hash_obj = hashlib.sha256()
hash_obj.update(password.encode('utf-8') + salt)
hash_base64 = base64.b64encode(hash_obj.digest()).decode('utf-8')
salt_base64 = base64.b64encode(salt).decode('utf-8')
return f'{hash_base64}:{salt_base64}'
def main():
password = input("Ange lösenordet du vill hash: ")
combined_hash_salt = generate_sha256_hash_and_salt(password)
print("Hash och Salt kombinerat för security.json:", combined_hash_salt)
if __name__ == "__main__":
main()
</code>
<code>import hashlib import os import base64 def generate_sha256_hash_and_salt(password): salt = os.urandom(16) hash_obj = hashlib.sha256() hash_obj.update(password.encode('utf-8') + salt) hash_base64 = base64.b64encode(hash_obj.digest()).decode('utf-8') salt_base64 = base64.b64encode(salt).decode('utf-8') return f'{hash_base64}:{salt_base64}' def main(): password = input("Ange lösenordet du vill hash: ") combined_hash_salt = generate_sha256_hash_and_salt(password) print("Hash och Salt kombinerat för security.json:", combined_hash_salt) if __name__ == "__main__": main() </code>
import hashlib
import os
import base64

def generate_sha256_hash_and_salt(password):
    salt = os.urandom(16)
    
    hash_obj = hashlib.sha256()
    
    hash_obj.update(password.encode('utf-8') + salt)
    
    hash_base64 = base64.b64encode(hash_obj.digest()).decode('utf-8')
    salt_base64 = base64.b64encode(salt).decode('utf-8')
    return f'{hash_base64}:{salt_base64}'

def main():
    password = input("Ange lösenordet du vill hash: ")
    combined_hash_salt = generate_sha256_hash_and_salt(password)
    print("Hash och Salt kombinerat för security.json:", combined_hash_salt)

if __name__ == "__main__":
    main()

enter image description here

It still doesn’t work, and when I restart and try, I get the following error:
Any idea what I am missing?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật