Skip to content

Respect return_to URL in OIDC callback error #4547

@renom

Description

@renom

Preflight checklist

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions