-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Review#2: handle review feedback and add docs for the session invalid…
…ate API.
- Loading branch information
Showing
7 changed files
with
152 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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,11 @@ | ||
[role="xpack"] | ||
[[session-management-api]] | ||
== {kib} session management APIs | ||
|
||
Allows managing {kib} <<xpack-security-session-management, user sessions>>. | ||
|
||
The following {kib} session management APIs are available: | ||
|
||
* <<session-management-api-invalidate, Invalidate sessions API>> to invalidate {kib} user sessions | ||
|
||
include::session-management/invalidate.asciidoc[] |
This file contains 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,108 @@ | ||
[[session-management-api-invalidate]] | ||
=== Invalidate sessions API | ||
++++ | ||
<titleabbrev>Invalidate sessions</titleabbrev> | ||
++++ | ||
|
||
experimental[] Invalidates {kib} user sessions that match provided query. | ||
|
||
[[session-management-api-invalidate-prereqs]] | ||
==== Prerequisite | ||
|
||
To use the invalidate sessions API, you must be a `superuser`. | ||
|
||
[[session-management-api-invalidate-request]] | ||
==== Request | ||
|
||
`POST <kibana host>:<port>/api/security/session/_invalidate` | ||
|
||
[role="child_attributes"] | ||
[[session-management-api-invalidate-request-body]] | ||
==== Request body | ||
|
||
`match`:: | ||
(Required, string) Specifies how {kib} should determine which sessions should be invalidated. Can either be `all` to invalidate all existing sessions, or `query` to only invalidate sessions that match the query specified in the additional `query` parameter. | ||
|
||
`query`:: | ||
(Optional, object) Specifies the query that {kib} should use to match the sessions that should be invalidated when `match` parameter is set to `query`. This parameter is forbidden if `match` is set to `all`. | ||
+ | ||
.Properties of `query` | ||
[%collapsible%open] | ||
===== | ||
`provider` ::: | ||
(Required, object) Contains required `type` and optional `name` string properties to match sessions that were created by the specific <<authentication-security-settings, authentication provider>>. | ||
`username` ::: | ||
(Optional, string) If specified, {kib} will only invalidate sessions that belong to a specific user. | ||
===== | ||
|
||
[[session-management-api-invalidate-response-body]] | ||
==== Response body | ||
|
||
`total`:: | ||
(number) The number of successfully invalidated sessions. | ||
|
||
[[session-management-api-invalidate-response-codes]] | ||
==== Response codes | ||
|
||
`200`:: | ||
Indicates a successful call. | ||
|
||
`403`:: | ||
Indicates that the user may not be authorized to invalidate sessions for other users, refer to <<session-management-api-invalidate-prereqs, Prerequisite section>>. | ||
|
||
==== Examples | ||
|
||
Invalidate all existing sessions: | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
$ curl -X POST api/security/session/_invalidate | ||
{ | ||
"match" : "all" | ||
} | ||
-------------------------------------------------- | ||
// KIBANA | ||
|
||
Invalidate sessions that were created by any <<saml, SAML authentication providers>> only: | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
$ curl -X POST api/security/session/_invalidate | ||
{ | ||
"match" : "query", | ||
"query": { | ||
"provider" : { "type": "saml" } | ||
} | ||
} | ||
-------------------------------------------------- | ||
// KIBANA | ||
|
||
Invalidate sessions that were created by the <<saml, SAML authentication provider>> with the name `saml1` only: | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
$ curl -X POST api/security/session/_invalidate | ||
{ | ||
"match" : "query", | ||
"query": { | ||
"provider" : { "type": "saml", "name": "saml1" } | ||
} | ||
} | ||
-------------------------------------------------- | ||
// KIBANA | ||
|
||
Invalidate sessions that were created by any <<oidc, OpenID Connect authentication providers>> for the user with the name `[email protected]` only: | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
$ curl -X POST api/security/session/_invalidate | ||
{ | ||
"match" : "query", | ||
"query": { | ||
"provider" : { "type": "oidc" }, | ||
"username": "[email protected]" | ||
} | ||
} | ||
-------------------------------------------------- | ||
// KIBANA |
This file contains 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 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 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 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 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