title: OAuth Token API Not Working In Elastic Search
body: <p>I'm new to Elastic search. Integrated my Spring boot application with Elastic search through <code>Java High Level Rest Client</code> and I've enabled security by providing below properties after setting up the certificate and passwords:</p>
  <pre><code>xpack.security.enabled: true
  xpack.security.transport.ssl.enabled: true
  xpack.security.transport.ssl.verification_mode: certificate
  xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
  xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
  xpack.security.http.ssl.enabled: true
  xpack.security.http.ssl.keystore.path: &quot;http.p12&quot;
  </code></pre>
  <p>I've done the required changes in kibana.yaml as well and I'm able to access it.
  Tried below call through Kibana to get the OAuth token:</p>
  <pre><code>   POST /_security/oauth2/token
      {
        &quot;grant_type&quot; : &quot;password&quot;,
        &quot;username&quot; : &quot;elastic&quot;,
        &quot;password&quot; : &quot;password_for_elastic_super_user&quot;
      }
  </code></pre>
  <p>Getting below error after executing in kibana:</p>
  <pre><code>{
    &quot;error&quot; : {
      &quot;root_cause&quot; : [
        {
          &quot;type&quot; : &quot;security_exception&quot;,
          &quot;reason&quot; : &quot;current license is non-compliant for [security tokens]&quot;,
          &quot;license.expired.feature&quot; : &quot;security tokens&quot;
        }
      ],
      &quot;type&quot; : &quot;security_exception&quot;,
      &quot;reason&quot; : &quot;current license is non-compliant for [security tokens]&quot;,
      &quot;license.expired.feature&quot; : &quot;security tokens&quot;
    },
    &quot;status&quot; : 403
  }
  </code></pre>
  <p>I've hit the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-license.html" rel="nofollow noreferrer">GET license API</a> as well, got below response:</p>
  <pre><code>{
    &quot;license&quot; : {
      &quot;status&quot; : &quot;active&quot;,
      &quot;uid&quot; : &quot;62b089de-422e-41f0-88c8-9ad76b27cd62&quot;,
      &quot;type&quot; : &quot;basic&quot;,
      &quot;issue_date&quot; : &quot;2020-06-25T07:17:48.310Z&quot;,
      &quot;issue_date_in_millis&quot; : 1593069468310,
      &quot;max_nodes&quot; : 1000,
      &quot;issued_to&quot; : &quot;elasticsearch&quot;,
      &quot;issuer&quot; : &quot;elasticsearch&quot;,
      &quot;start_date_in_millis&quot; : -1
    }
  }
  </code></pre>
  <p><strong>Can anyone please help how to fix this?</strong></p>