Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for basic authentication to the Solr health check #2261

Open
HalHunt opened this issue Jul 12, 2024 · 3 comments
Open

Add support for basic authentication to the Solr health check #2261

HalHunt opened this issue Jul 12, 2024 · 3 comments

Comments

@HalHunt
Copy link

HalHunt commented Jul 12, 2024

What would you like to be added:
I didn't see a way to supply a username and password to the Solr health check. I tired to add the username and password to the SolrOptions.Uri as in http://solr:SolrRocks@localhost:8983/solr without success. Am I missing anything?

Why is this needed:
To allow the Solr health check to be used in more realistic enterprise environments that use SSL and basic authentication.

The fix is relatively easy and I have a PR in the works however I need some guidance on unit tests. I have the correct new unit tests but I'm not sure how to support both Solr configurations (i.e. no auth and with auth) in the same docker container. Any guidance is greatly appreciated.

@Alirexaa
Copy link
Collaborator

Could you send PR?
I will check it.

@HalHunt
Copy link
Author

HalHunt commented Jul 14, 2024

@Alirexaa done! #2263

@HalHunt
Copy link
Author

HalHunt commented Jul 16, 2024

Found this to configure Solr to support both no auth + basic auth. blockUnknown is the key.

{
  "authentication":{ 
    "blockUnknown": false, 
    "class":"solr.BasicAuthPlugin",
    "credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="}, 
    "realm":"solr", 
    "forwardCredentials": false 
  },
  "authorization":{
    "class":"solr.RuleBasedAuthorizationPlugin",
    "permissions":[{"name":"security-edit",
        "role":"admin"}], 
    "user-role":{"solr":"admin"} 
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants