Add Tests for findSamlRealm#35905
Merged
jkakavas merged 2 commits intoelastic:masterfrom Nov 27, 2018
Merged
Conversation
This commit allows Elasticsearch to match and handle correctly `SamlPrepareAuthenticationRequest`s that contain only the realm name of the SAML realm or `SamlPrepareAuthenticationRequest`s that contain both the realm name and the acsURL but the acsURL doesn't match the configured one in the SAML realm configuration. This allows for easier configuration of Kibana and also solves issues like elastic/kibana#22954. It also allows easier configuration of custom web apps talking to Elasticsearch as the realm name is anecdotally easier to copy-paste/keep in sync/alter Since we only allow the configuration of a single ACS URL, there is effectively a 1-1 mapping between SAML realm and ACS URL and any of the two should be sufficient to match the realm. However, since in Kibana, the realm name will be an explicit setting and the ACS URL is a constructed and implicit one, we fail the `SamlPrepareAuthenticationRequest` when the realm is defined but not matching.
Collaborator
|
Pinging @elastic/es-security |
4 tasks
Contributor
|
I think this is a bad idea. |
Contributor
Author
|
Thanks for the quick feedback Tim. I'll leave the findSamlRealms as is so that if a request contains an ACS URL, it also needs to match. |
Contributor
|
Thanks @jkakavas. Sorry if my response was too direct, it was late and I wanted to get something to you before I went to bed. |
jkakavas
added a commit
that referenced
this pull request
Nov 27, 2018
This commit adds a test for handling correctly all they possible `SamlPrepareAuthenticationRequest` parameter combinations that we might get from Kibana or a custom web application talking to the SAML APIs. We can match the correct SAML realm based either on the realm name or the ACS URL. If both are included in the request then both need to match the realm configuration.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.