forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs and rest api spec for saml complete logout API (elastic#72867)
This PR adds the documentation and Rest API spec file for the SAML complete logout API. It is a (overdued) follow up for elastic#56316
- Loading branch information
Showing
8 changed files
with
138 additions
and
12 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
rest-api-spec/src/main/resources/rest-api-spec/api/security.saml_complete_logout.json
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,28 @@ | ||
{ | ||
"security.saml_complete_logout":{ | ||
"documentation":{ | ||
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html", | ||
"description":"Verifies the logout response sent from the SAML IdP" | ||
}, | ||
"stability":"stable", | ||
"visibility":"public", | ||
"headers":{ | ||
"accept": [ "application/json"], | ||
"content_type": ["application/json"] | ||
}, | ||
"url":{ | ||
"paths":[ | ||
{ | ||
"path":"/_security/saml/complete_logout", | ||
"methods":[ | ||
"POST" | ||
] | ||
} | ||
] | ||
}, | ||
"body":{ | ||
"description":"The logout response to verify", | ||
"required":true | ||
} | ||
} | ||
} |
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
89 changes: 89 additions & 0 deletions
89
x-pack/docs/en/rest-api/security/saml-complete-logout-api.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,89 @@ | ||
[role="xpack"] | ||
[[security-api-saml-complete-logout]] | ||
=== SAML complete logout API | ||
++++ | ||
<titleabbrev>SAML complete logout</titleabbrev> | ||
++++ | ||
|
||
Verifies the logout response sent from the SAML IdP. | ||
|
||
NOTE: This API is intended for use by custom web applications other than {kib}. | ||
If you are using {kib}, see the <<saml-guide>>. | ||
|
||
[[security-api-saml-complete-logout-request]] | ||
==== {api-request-title} | ||
|
||
`POST /_security/saml/complete_logout` | ||
|
||
[[security-api-saml-complete-logout-desc]] | ||
==== {api-description-title} | ||
|
||
The SAML IdP may send a logout response back to the SP after handling | ||
the <<security-api-saml-logout,SP-initiated SAML Single Logout>>. | ||
This API verifies the response by ensuring the content is relevant | ||
and validating its signature. An empty response is returned if | ||
the verification process is successful. | ||
The response can be sent by the IdP with either the HTTP-Redirect or | ||
the HTTP-Post binding. The caller of this API must prepare the request | ||
accordingly so that this API can handle either of them. | ||
|
||
{es} exposes all the necessary SAML related functionality via the SAML APIs. | ||
These APIs are used internally by {kib} in order to provide SAML based | ||
authentication, but can also be used by other custom web applications or other | ||
clients. See also <<security-api-saml-authenticate,SAML authenticate API>>, | ||
<<security-api-saml-prepare-authentication,SAML prepare authentication API>>, | ||
<<security-api-saml-invalidate,SAML invalidate API>>, and | ||
<<security-api-saml-logout,SAML logout API>>. | ||
|
||
[[security-api-saml-complete-logout-request-body]] | ||
==== {api-request-body-title} | ||
|
||
`realm`:: | ||
(Required, string) The name of the SAML realm in {es} for which the configuration is | ||
used to verify the logout response. | ||
|
||
`ids`:: | ||
(Required, array) A json array with all the valid SAML Request Ids that the caller of | ||
the API has for the current user. | ||
|
||
`queryString`:: | ||
(Optional, string) If the SAML IdP sends the logout response with the HTTP-Redirect | ||
binding, this field must be set to the query string of the redirect URI. | ||
|
||
`content`:: | ||
(Optional, string) If the SAML IdP sends the logout response with the HTTP-Post | ||
binding, this field must be set to the value of the `SAMLResponse` form parameter | ||
from the logout response. | ||
|
||
[[security-api-saml-complete-logout-example]] | ||
==== {api-examples-title} | ||
|
||
The following example verifies the logout response sent by the SAML IdP | ||
using the HTTP-Redirect binding: | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
POST /_security/saml/complete_logout | ||
{ | ||
"realm": "saml1", | ||
"ids": [ "_1c368075e0b3..." ], | ||
"queryString": "SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK..." | ||
} | ||
-------------------------------------------------- | ||
// TEST[skip:can't test this without a valid SAML Logout Response] | ||
|
||
If the logout response is sent with the HTTP-Post binding, it can be verified | ||
as the follows: | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
POST /_security/saml/complete_logout | ||
{ | ||
"realm": "saml1", | ||
"ids": [ "_1c368075e0b3..." ], | ||
"content": "PHNhbWxwOkxvZ291dFJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46..." | ||
} | ||
-------------------------------------------------- | ||
// TEST[skip:can't test this without a valid SAML Logout Response] | ||
|
||
The API returns an empty response on success. |
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