Skip to content

Conversation

@lovasoa
Copy link
Collaborator

@lovasoa lovasoa commented Dec 2, 2025

Add a secure OIDC logout endpoint and a sqlpage.oidc_logout_url function 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_endpoint if available, otherwise performs local logout.


Open in Cursor Open in Web

cursoragent and others added 5 commits December 2, 2025 22:31
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
Copy link

cursor bot commented Dec 2, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@lovasoa lovasoa marked this pull request as ready for review December 3, 2025 09:42
cursoragent and others added 2 commits December 3, 2025 09:45
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants