-
-
Notifications
You must be signed in to change notification settings - Fork 158
Implement secure oidc logout endpoint and sql function #1141
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
Merged
lovasoa
merged 13 commits into
main
from
cursor/implement-secure-oidc-logout-endpoint-and-sql-function-claude-4.5-opus-high-thinking-47fd
Dec 7, 2025
Merged
Implement secure oidc logout endpoint and sql function #1141
lovasoa
merged 13 commits into
main
from
cursor/implement-secure-oidc-logout-endpoint-and-sql-function-claude-4.5-opus-high-thinking-47fd
Dec 7, 2025
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
Co-authored-by: contact <[email protected]>
Co-authored-by: contact <[email protected]>
Co-authored-by: contact <[email protected]>
Co-authored-by: contact <[email protected]>
This commit introduces the `oidc_logout_url` function, allowing users to securely log out of OIDC-authenticated applications. It includes CSRF protection and handles redirection to the OIDC provider's logout endpoint. Co-authored-by: contact <[email protected]>
|
Cursor Agent can help with this pull request. Just |
lovasoa
commented
Dec 3, 2025
Co-authored-by: contact <[email protected]>
This commit implements secure OIDC logout by: - Using sqlpage.oidc_logout_url() to generate the logout URL. - Ensuring CSRF protection during the logout process. - Redirecting to the OIDC provider's logout endpoint. - Redirecting back to the homepage after logout. - Adding absolute URI for post logout redirect URI.
This commit modifies the build_absolute_uri function to include a scheme parameter, allowing for more flexible URL construction. The function now dynamically sets the URL scheme based on the request context, improving compatibility with different environments.
…ndling This commit refactors the OIDC logout process by introducing a new function, `parse_logout_params`, to streamline the extraction of logout parameters from the request. It also updates the logout token creation and verification logic, improving security by ensuring the signature is computed correctly. Additionally, the `create_logout_url` function is modified to include a timestamp and signature in the generated URL, enhancing the logout flow's integrity.
This commit refines the `create_logout_url` function to utilize a query string builder for constructing the logout URL, enhancing readability and maintainability. Additionally, the `parse_logout_params` function is updated to use `Query::into_inner`, streamlining the extraction of logout parameters from the request.
This commit simplifies the removal of authentication and nonce cookies during the OIDC logout process by consolidating the cookie removal logic into a single method call for each cookie, enhancing code clarity and maintainability.
This commit updates the cookie removal process during OIDC logout by utilizing the `Cookie::build` method to specify cookie attributes, improving clarity and ensuring proper cookie handling.
- Added new function `sqlpage.oidc_logout_url(redirect_uri)` to generate secure logout URLs for OIDC users, supporting RP-Initiated Logout. - Fixed compatibility issues with Auth0 for OpenID-Connect authentication.
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.
Add a secure OIDC logout endpoint and a
sqlpage.oidc_logout_urlfunction to provide CSRF-protected logout functionality.The logout endpoint uses HMAC-signed tokens for CSRF protection, as SQLPage functions cannot directly set cookies for traditional CSRF tokens. This ensures the logout link is self-verifying and secure. It also handles redirection to the OIDC provider's
end_session_endpointif available, otherwise performs local logout.