Document the SameSite requirement for SAML reauthentication - #1472
Open
labkey-bpatel wants to merge 1 commit into
Open
Document the SameSite requirement for SAML reauthentication#1472labkey-bpatel wants to merge 1 commit into
labkey-bpatel wants to merge 1 commit into
Conversation
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.
Rationale
SAML IdPs return authentication responses using a cross-site POST. In Chrome browsers, a JSESSIONID without an explicit
SameSitevalue is treated asLaxand is not sent with that POST, except for a short grace period of about two minutes after the cookie is created.Reauthentication uses the existing signed-in session and does not create a new one. This means reauthentication may work shortly after sign-in, but after the grace period, the browser does not send the JSESSIONID with the SAML response.
Without the session cookie, LabKey sees the request as coming from a guest. This causes two confusing behaviors:
This was confirmed in Chrome DevTools: the signed-in JSESSIONID was excluded from the SAML ACS POST, and the response created a new, unrelated session ID. This behavior was not observed in Firefox, however.
Related Pull Requests
Changes
server/configs/application.properties, alongside the three session cookie settings that address it.same-site,secure, andhttp-onlycommented out.SameSite=Noneis only honored on Secure cookies, so enabling them requires HTTPS; leaving them on by default would break sign-in on plain HTTP deployments. Deployments using SAML reauthentication should uncomment them.Note: since the settings ship commented out, this PR alone doesn't fix anything for existing SAML deployments - they still have to uncomment. If we rather have it be fixed by default, that's a deliberate decision to force HTTPS on every deployment, and worth stating explicitly rather than leaving implicit.