OIDC RP-Initiated Logout: SPA does not follow 303 redirect after POST /oidc/session/end/confirm #418
Labels
No labels
bug
chore
documentation
enhancement
help
in-progress
question
ready-for-release
released
translation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
adam/gate#418
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
When using RP-Initiated Logout (
/oidc/session/end), the VoidAuth SPA logout confirmation page (/logout/<id>) does not follow the 303 redirect returned byPOST /oidc/session/end/confirm.Steps to Reproduce
PostLogout URL(e.g.http://localhost:3000/auth/logged-out)GET /oidc/session/end?id_token_hint=<token>&post_logout_redirect_uri=http://localhost:3000/auth/logged-out/logout/<id>(confirmation page)http://localhost:3000/auth/logged-outDebug Logs
With
ENABLE_DEBUG: true, the server logs show:POST /oidc/session/end/confirm → 303, location: http://localhost:3000/auth/logged-out
The backend correctly returns a
303 See Otherwith theLocationheader pointing to thepost_logout_redirect_uri. However, the SPA frontend appears to handle the POST via JavaScript (AJAX/fetch) rather than a native form submission, so the browser does not follow the 303 redirect.Clicking "Yes" a second time triggers a second POST which returns
400 Bad Requestwith{"error":"invalid_request","error_description":"could not find logout details"}because the session was already destroyed by the first POST.Environment
voidauth/voidauth:latest)DISABLE_HTTPS: true,ALLOW_INSECURE_REDIRECTS: trueSuggested Fix
The logout confirmation page SPA should either:
<form>submission instead of a JavaScript fetch/AJAX call, so the browser natively follows the 303 redirectLocationheader from the 303 response and dowindow.location.href = locationI am not able to replicate this bug in my development environment. When I use the RP-Initiated Logout path
http://auth.nqn.localhost/voidauth/oidc/session/end?client_id=debugger&post_logout_redirect_uri=http://whoami.nqn.localhost/postlogoutthe resulting303redirect is followed correctly tohttp://whoami.nqn.localhost/postlogoutafter logout is complete