Skip to content

Commit

Permalink
Added clarification on b64 encoding of API key (#78394) (#78841)
Browse files Browse the repository at this point in the history
* Added clarification on b64 encoding of API key

The current documentation does not specify how to encode the response to get a valid api key, I added it from the info found here: elastic/elasticsearch#50235 (comment)

* Updated for consistency with Elasticsearch docs

#78394 (review)

Co-authored-by: Théo Frasquet <theo2354@users.noreply.github.com>
  • Loading branch information
gchaps and theo2354 authored Sep 29, 2020
1 parent d0d5e24 commit 057f4cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/user/security/api-keys/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ The response should look something like this:
"api_key" : "FD6P5UA4QCWlZZQhYF3YGw"
}

Now, you can use the API key to request {kib} roles. You will need
to base64-encode the `id` and `api_key` provided in the response
and add it to your request as an authorization header. For example:
Now, you can use the API key to request {kib} roles. You'll need to send a request with a
`Authorization` header with a value having the prefix `ApiKey` followed by the credentials,
where credentials is the base64 encoding of `id` and `api_key` joined by a colon. For example:

[source,js]
curl --location --request GET 'http://localhost:5601/api/security/role' \
Expand Down

0 comments on commit 057f4cc

Please sign in to comment.