Fix OIDC single sign-out breaking due to SameSite cookie changes in Moodle core - #3387
Open
Lai Wei (weilai-irl) wants to merge 1 commit into
Open
Fix OIDC single sign-out breaking due to SameSite cookie changes in Moodle core#3387Lai Wei (weilai-irl) wants to merge 1 commit into
Lai Wei (weilai-irl) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the OIDC single sign-out implementation to avoid relying on the user’s MoodleSession cookie (which may be absent due to SameSite behavior), by persisting the Moodle session id at login time and terminating that session directly during IdP-initiated logout. It also adjusts SID mapping cleanup to be based on whether the Moodle session still exists, rather than a fixed age threshold.
Changes:
- Store the active Moodle session id alongside the IdP
sidmapping at login, and destroy that session during SSO logout. - Add
sessionidto theauth_oidc_sidschema (install + upgrade) and update privacy metadata + language strings. - Update the cleanup scheduled task and its unit test to retain mappings while the corresponding Moodle session exists.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| auth/oidc/version.php | Bumps plugin version to include this change set. |
| auth/oidc/classes/loginflow/authcode.php | Persists the current Moodle session id into auth_oidc_sid at login. |
| auth/oidc/logout.php | Uses stored session id to terminate the correct session during IdP-initiated logout. |
| auth/oidc/classes/task/cleanup_oidc_sid.php | Changes cleanup criteria from “older than 1 day” to “session no longer exists”. |
| auth/oidc/tests/task/cleanup_oidc_sid_test.php | Updates unit test to match the new cleanup behavior and session-existence logic. |
| auth/oidc/db/install.xml | Adds sessionid column to auth_oidc_sid for new installs. |
| auth/oidc/db/upgrade.php | Adds upgrade step to introduce sessionid to existing installs. |
| auth/oidc/classes/privacy/provider.php | Includes sessionid in declared privacy metadata. |
| auth/oidc/lang/en/auth_oidc.php | Adds the privacy metadata string for sessionid. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Lai Wei (weilai-irl)
force-pushed
the
wip-132848-m502
branch
from
August 11, 2026 10:25
bd75e63 to
6a0b63c
Compare
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.