Security API
Update HTTP Auth
Set or update HTTP Basic Authentication credentials for your Opensolr Index. Protects your Solr endpoints with username/password authentication.
Endpoint
GET https://opensolr.com/solr_manager/api/update_http_auth
Parameters
| Parameter | Status | Description |
|---|---|---|
email | Required | Your Opensolr registration email address |
api_key | Required | Your Opensolr API key |
core_name | Required | The name of the index you wish to add or update HTTP Auth protection for |
username | Required | The username for HTTP Basic Auth on this index |
password | Required | The password for HTTP Basic Auth on this index |
Once HTTP Auth is enabled, all requests to your Solr index (queries, updates, admin) will require the credentials you set here. Make sure your application is configured with the new credentials before enabling this.
Code Examples
cURL
curl -s "https://opensolr.com/solr_manager/api/update_http_auth?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_solr_core&username=index_auth_username&password=index_auth_password"
PHP
$params = http_build_query([ 'email' => 'YOUR_EMAIL', 'api_key' => 'YOUR_API_KEY', 'core_name' => 'my_solr_core', 'username' => 'index_auth_username', 'password' => 'index_auth_password', ]); $response = file_get_contents("https://opensolr.com/solr_manager/api/update_http_auth?{$params}"); $result = json_decode($response, true); print_r($result);
Python
import requests response = requests.get("https://opensolr.com/solr_manager/api/update_http_auth", params={ "email": "YOUR_EMAIL", "api_key": "YOUR_API_KEY", "core_name": "my_solr_core", "username": "index_auth_username", "password": "index_auth_password", }) print(response.json())
Related Documentation
Update HTTP AuthSet or update HTTP Basic Auth credentials for your index.
Add IP Access RuleGrant access to specific IPs for your Solr endpoints.
Get IP ListRetrieve all IP access rules configured for your index.
Remove IP AccessRevoke IP-based access rules from your index.
Need help securing your Opensolr Indexes? We are here to help.
Contact Support