API Key for Elastic Cloud

Is there a way to create an API key instead of a username:password combination?
If not an API key, is there an alternative?

I have developers using React javascript and the username and password is clear in transmissions.

Any way around this?

Hi @mc1392

2.0 has a Swagger-documented login endpoint that returns a JWT token: https://www.elastic.co/guide/en/cloud-enterprise/current/login.html (/api/v1/users/auth/login)

In 1.x there is an undocumented endpoint (/api/v0.1/login) identical in functionality and format (except for returning "ok": true|false in the return object, in addition to the 200/401 HTTP status code)

Alex

Thanks Alex!

Question, to what URL do I post this request:

what_goes_here/api/v1/users/auth/login

Is it my instance end point?

Oh sorry I might have misunderstood the question actually

Do you have an account on Elastic Cloud (vs a private ECE deployment)

And what you want is to login to an Elasticsearch cluster that you have created in the Cloud?

If so then ignore my last answer, here's a more useful one :slight_smile:

If you are running ES version 5.x specifically then you should be able to use the ES token API to get bearer tokens:

https://www.elastic.co/guide/en/elasticsearch/reference/5.6/security-api-tokens.html

The following setting needs to be enabled to support this: xpack.security.authc.token.enabled https://www.elastic.co/guide/en/elasticsearch/reference/6.4/security-settings.html#token-service-settings

This can be done via a support request since only admins have access to that parameter.

If you are running ES version 6.x then unfortunately it is not currently possible to set because it requires e2e TLS be enabled, which we are currently rolling out BUT this should be days away (it will likely get announced on the blog because it will result in SAML being supported - another option your devs could consider)

So if you need to test you can spin up a small 5.x cluster, but 6.x will definitely be supported very soon

Alex

I am using the Elastic Cloud Service.
My developer is connecting using React Javascript.

Im using version 6.2.2

Your best bet for Elastic Cloud support is to create a request as per https://www.elastic.co/cloud/as-a-service/support.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.