Fix OIDC single sign-out breaking due to SameSite cookie changes in Moodle core - #3386
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#3386Lai 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 auth_oidc plugin’s single logout (SLO) implementation so it can terminate the correct Moodle session even when the IdP’s logout request no longer includes the user’s MoodleSession cookie (e.g., due to SameSite behavior changes).
Changes:
- Persist the Moodle session id alongside the OIDC
sidmapping at login time and destroy that session during SLO. - Change the scheduled cleanup task to remove
auth_oidc_sidmappings based on Moodle session existence (instead of age). - Add DB schema + privacy metadata for the new
sessionidfield and update unit tests accordingly.
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 (currently using a float). |
| auth/oidc/classes/loginflow/authcode.php | Stores the current Moodle session id when creating the OIDC sid mapping. |
| auth/oidc/logout.php | Uses the stored session id to destroy the correct session during IdP-initiated logout. |
| auth/oidc/classes/task/cleanup_oidc_sid.php | Cleans up auth_oidc_sid mappings by checking whether the linked Moodle session still exists. |
| auth/oidc/tests/task/cleanup_oidc_sid_test.php | Updates tests to validate cleanup behavior based on session existence. |
| auth/oidc/db/install.xml | Adds the sessionid column to the auth_oidc_sid table schema. |
| auth/oidc/db/upgrade.php | Adds the upgrade step to create the new sessionid column. |
| auth/oidc/classes/privacy/provider.php | Includes sessionid in privacy metadata export/delete handling. |
| auth/oidc/lang/en/auth_oidc.php | Adds the language string describing sessionid privacy metadata. |
💡 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-m501
branch
from
August 11, 2026 10:25
ed8108e to
0b6e93f
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.