-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Add docs and rest api spec for saml complete logout API #72867
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
89a85f3
Add docs and rest api spec for saml complete logout
ywangd 3fe45e4
Fix docs build
ywangd 86f8d41
remove linebreak
ywangd ce3394a
Merge remote-tracking branch 'origin/master' into es-67189-saml-compl…
ywangd 224e8d3
address feedback
ywangd 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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think our APIs generally prefer snake case. So this should have been
query_string
instead ofqueryString
. This is unfortunately another oversight of the original PR #56316. I can deprecate it and add a newquery_string
field in another follow-up PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, maybe raise an issue for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I raised #73543