-
Notifications
You must be signed in to change notification settings - Fork 256
Add token based authn documentation in stack docs #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bizybot
merged 23 commits into
elastic:master
from
bizybot:token-based-authn-services-documentation
Feb 6, 2019
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
a98843f
Add token based authn documentation in stack docs
c2e8292
Commit suggested document change.
jkakavas 9a8ed5d
Commit suggested documentation change
jkakavas 53e8f3a
Address review comments
dae3e35
Merge branch 'api-key-service-stack-documentation' into token-based-a…
67b6b7a
Commit suggested change
jaymode 74ea776
Commit suggested change
jaymode 4a86b97
Commit suggested change
jaymode f1c4121
Address review comments
7d8bbe4
[DOCS] Edits the authentication overview
lcawl 5144be2
[DOCS] Edits token-based authentication services
lcawl bf578cc
[DOCS] Updates intro to realms
lcawl cbd626d
Address review comments
0280d87
merge changes from PR back to branch
072d989
Merge branch 'api-key-service-stack-documentation' into token-based-a…
94a1fa6
Commit suggested change
lcawl 90775e5
Commit suggested change
lcawl 09a8db5
Commit suggested change
lcawl 9643409
Commit suggested change
lcawl b727543
Commit suggested change
lcawl 09f3fa7
Merge branch 'master' into token-based-authn-services-documentation
bd62107
Address review comment
0b5cc32
Address review comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
docs/en/stack/security/authentication/token-authentication-services.asciidoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[role="xpack"] | ||
[[token-authentication-services]] | ||
=== Token-based authentication services | ||
|
||
The {stack-security-features} authenticate users by using realms and one or more token-based | ||
authentication services. The token-based authentication services are used for | ||
authentication and for the management of tokens. These tokens can be used as | ||
credentials attached to requests that are sent to {es}. When {es} receives a request | ||
that must be authenticated, it consults first the token-based authentication | ||
services then the realm chain. | ||
|
||
The {security-features} provide the following built-in token-based authentication | ||
services, which are listed in the order they are consulted: | ||
|
||
_token-service_:: | ||
The token service uses the {ref}/security-api-get-token.html[get token API] to | ||
generate access tokens and refresh tokens based on the OAuth2 specification. | ||
The access token is a short-lived token. By default, it expires after 20 minutes | ||
but it can be configured to last a maximum of 1 hour. It can be refreshed by | ||
using a refresh token, which has a lifetime of 24 hours. The access token is a | ||
bearer token. You can use it by sending a request with an `Authorization` | ||
header with a value that has the prefix "Bearer " followed by the value of the | ||
access token. For example: | ||
+ | ||
-- | ||
[source,shell] | ||
-------------------------------------------------- | ||
curl -H "Authorization: Bearer dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==" http://localhost:9200/_cluster/health | ||
-------------------------------------------------- | ||
// NOTCONSOLE | ||
-- | ||
|
||
_api-key-service_:: | ||
The API key service uses the | ||
{ref}/security-api-create-api-key.html[create API key API] to generate API keys. | ||
By default, the API keys do not expire. When you make a request to create API | ||
keys, you can specify an expiration and permissions for the API key. The | ||
permissions are limited by the authenticated user's permissions. You can use the | ||
API key by sending a request with an `Authorization` header with a value that | ||
has the prefix "ApiKey " followed by the credentials. The credentials are the | ||
base64 encoding of the API key ID and the API key joined by a colon. For example: | ||
+ | ||
-- | ||
[source,shell] | ||
-------------------------------------------------- | ||
curl -H "Authorization: ApiKey VnVhQ2ZHY0JDZGJrUW0tZTVhT3g6dWkybHAyYXhUTm1zeWFrdzl0dk5udw==" http://localhost:9200/_cluster/health | ||
-------------------------------------------------- | ||
// NOTCONSOLE | ||
-- | ||
|
||
Depending on your use case, you may want to decide on the lifetime of the tokens | ||
generated by these services. You can then use this information to decide which | ||
service to use to generate and manage the tokens. Non-expiring API keys may seem | ||
like the easy option but you must consider the security implications that come | ||
with non-expiring keys. Both the _token-service_ and _api-key-service_ permit | ||
you to invalidate the tokens. See | ||
{ref}/security-api-invalidate-token.html[invalidate token API] and | ||
{ref}/security-api-invalidate-api-key.html[invalidate API key API]. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.