-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Respect return_to URL in OIDC callback error #4547
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe the bug
When an OIDC registration flow is started via JSON API requests, it anyway shows an HTML form to refill data if any web hook error is occurred during the OIDC callback request. It redirects to selfservice.flows.registration.ui_url, but we need to proceed to return_to url and show a form in our site's UI (e.g. requesting /self-service/registration/flows?id=<flow_id> and rendering form in our UI).
Option selfservice.flows.registration.ui_url is in the config of Ory Kratos and can't be adjusted on the fly, so in case of error the url is always the same (regardless url that's specified in return_to).
Reproducing the bug
Try to register with return_to. You'll be redirected to selfservice.flows.registration.ui_url instead of return_to if any error is returned from web hook.
Relevant log output
Relevant configuration
Version
v25.4.0
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Docker Compose
Additional Context
No response