Would you like to learn how to use the ElasticSearch Token-based authentication? In this tutorial, we are going to show you how to create an Elasticsearch authentication token and use the token to perform queries to the ElasticSearch server.
• Ubuntu 18
• Ubuntu 19
• ElasticSearch 7.6.2
In our example, The ElastiSearch server IP address is 192.168.100.7.
ElasticSearch Related Tutorial:
On this page, we offer quick access to a list of tutorials related to ElasticSearch installation.
Tutorial ElasticSearch – Authentication Token
Install the required packages.
Test your communication with the ElasticSearch server.
Here is the command output:
Keep in mind that the token-based authentication requires an HTTPS connection to ElasticSearch.
To enable the Token-based authentication, you need to create a certificate and enable the following features on the Elasticsearch configuration file.
Create an ElasticSearch token.
Here is the command output:
In our example, we created an authentication token to the user account named: Elastic.
• Token: y/auAxZjVXlhQ090bFRLdXBSR1ZlV1Q2ckNR
The token is valid for 1200 seconds.
Important! We used the HTTPS protocol instead of the HTTP.
Use the token to perform a query to the ElasticSearch server.
Here is the command output:
Congratulations! You are able to use an ElasticSearch token for authentication.