How to create an API key for access without requiring basic authentication

Opensearch version 2.5.0

In elasticsearch, this can be done by using POST /_security/api_key but it does not work in Opensearch.
Can someone help here.
The idea is to send a search request using api key for authorization.
https://opensearchURL:9200/index/_search?pretty {‘content-type’:‘application/json’, ‘Authorization’: ‘Basic api Key’}

Describe the issue:

Configuration:

Relevant Logs or Screenshots:

Hey @Apurw

Did any of these work for you?

In the documentation i can see only an instruction how to manage security area of the cluster by api and how to configure that. But how about searches and others from https://opensearch.org/docs/latest/api-reference/index/ How should the query with auth look like? What type of auth we can use? As in the first post, can we generate apikey in Opensearch?

Best

Hi @Apurw

You can use one of the authentication backends:

In order to create and configure a new authentication or authorization backend, you should add configurations to the config.yml:

After that, you should apply your configuration changes using securityadmin.sh tool:

1 Like

There is no API key for authentication in OpenSearch.

You can create a new issue with this feature at the following link: