-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Add Tests for findSamlRealm #35905
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 Tests for findSamlRealm #35905
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.
Pinging @elastic/es-security |
I think this is a bad idea. |
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. |
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. |
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.
👍
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.
No description provided.