-
-
Notifications
You must be signed in to change notification settings - Fork 158
Update logout url logic #1148
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
base: main
Are you sure you want to change the base?
Update logout url logic #1148
Conversation
Co-authored-by: contact <[email protected]>
|
Cursor Agent can help with this pull request. Just |
| redirect_uri: &str, | ||
| site_prefix: &str, | ||
| client_secret: &str, | ||
| user_id: Option<&str>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cursoragent the user id should be mandatory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| user_id: Option<&str>, | ||
| ) -> String { | ||
| let timestamp = chrono::Utc::now().timestamp(); | ||
| let signature = compute_logout_signature(redirect_uri, timestamp, client_secret); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cursoragent the user id should be part of the signed message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch — right now the HMAC only covers redirect_uri and timestamp, so the user_id we append wouldn’t be protected. I’ll update compute_logout_signature (and verify_logout_params) to append the user_id bytes into the MAC input, make the query parameter required whenever we have a logged-in user, and adjust the tests accordingly so the entire logout URL (including the user id) is signed and validated.
Learn more about Cursor Agents
Include the OIDC user ID in logout URLs for authenticated users and fall back to the redirect URL for anonymous users to provide a meaningful destination.