title: How I can get authentication token or do loging in Elastic Search using REST API? For example from POSTMAN
body: <p>I trying list data from Elastic Search using the REST API from POSTMAN.
  But I has ´security_exception´</p>
  
  <p>I read the elastic documentation from <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html" rel="noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html</a> 
  but isn't work.</p>
  
  <p>I'm using Elastic 7.2</p>
  
  <pre><code>Method: POST
  
  Content-type: Application/json
  
  URI: http://xxx.xxx.xxx.xxx:9200/_security/oauth2/token
  
  BODY: 
  
  {
    "grant_type" : "password",
    "username" : "user_name",
    "password" : "correct_password"
  }
  
  </code></pre>
  
  <p>I need this service return the authentication token. But this is the response:</p>
  
  <pre><code>{
      "error": {
          "root_cause": [
              {
                  "type": "security_exception",
                  "reason": "missing authentication credentials for REST request [/_security/oauth2/token]",
                  "header": {
                      "WWW-Authenticate": "Basic realm=\"security\" charset=\"UTF-8\""
                  }
              }
          ],
          "type": "security_exception",
          "reason": "missing authentication credentials for REST request [/_security/oauth2/token]",
          "header": {
              "WWW-Authenticate": "Basic realm=\"security\" charset=\"UTF-8\""
          }
      },
      "status": 401
  }
  
  </code></pre>