API - Update HTTP Auth

Security
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

ParameterStatusDescription
emailRequiredYour Opensolr registration email address
api_keyRequiredYour Opensolr API key
core_nameRequiredThe name of the index you wish to add or update HTTP Auth protection for
usernameRequiredThe username for HTTP Basic Auth on this index
passwordRequiredThe 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

Need help securing your Opensolr Indexes? We are here to help.

Contact Support