title: How to perform token authentication in elasticsearch?
body: <p>I'm testing Elasticsearch in development mode with docker official image.</p>
  
  <p>The basic install is based on X_pack and basic authentication.</p>
  
  <p>Everything works fine by performing curl like:</p>
  
  <pre><code>curl -XPUT -u elastic:elasticpassword "http://localhost:9200/movies/movie/1" -d'
  {
    "title": "The Godfather",
    "director": "Francis Ford Coppola",
    "year": 1972, "user":"elastic", "password":"changeme"
  }'
  </code></pre>
  
  <p>But is there a way to perform a token request (with user and password) and then query Elasticsearch with the token. Instead of having to specify user/password every time I perform a query?</p>