handsome-agency-20541
08/28/2025, 12:22 PMchilly-king-10285
08/28/2025, 12:22 PMchilly-king-10285
08/28/2025, 12:23 PMhandsome-agency-20541
08/28/2025, 12:31 PMreturn_to
is exactly what I’m tying to understand. What makes “Forgot password” add a non-empty return_to
to /self-service/recovery/browser
redirect it makes?chilly-king-10285
08/28/2025, 12:31 PMchilly-king-10285
08/28/2025, 12:31 PMhandsome-agency-20541
08/28/2025, 1:03 PM/oauth2/auth
, passing my own callback URL into redirect_url
.
• Ory responds with /ui/login?login_challenge=…
redirect in both cases…
• Which leads to /self-service/login/browser?aal=&refresh=&return_to=&organization=&via=&login_challenge=…
in both cases (note that return_to
is empty)
• Which leads to /ui/login?flow=…
in both cases. It’s a HTML page which, right in the response, contains a “Forgot password” link with a non-empty redirect_url
only in my “Production” case. Moreover, it uses an absolute URL and refers to my project not on its configured host, but by on <project-slug>.<http://projects.oryapis.com|projects.oryapis.com>
.
What can cause this behaviour?chilly-king-10285
08/28/2025, 1:03 PMchilly-king-10285
08/28/2025, 1:04 PMhandsome-agency-20541
08/28/2025, 1:13 PMthe Account Experience can inject a return target based on the OAuth2 login_challenge, but this isn’t guaranteed and differs across projects/configs.Can you tell what exactly in the “projects/configs” affects the “Forgot password” URL? Also, what does it mean “this isn’t guaranteed”? Can I, for example, turn make it never populate the
return_url
?chilly-king-10285
08/28/2025, 1:13 PMchilly-king-10285
08/28/2025, 1:13 PMhandsome-agency-20541
08/28/2025, 1:47 PMreturn_to
or not from OAuth2 is governed by an undocumented setting oauth2_provider/override_return_to
.
To turn it off for my project I had to use the following ory
CLI snippet
ory patch project $ORY_PROJECT_ID --replace '/services/identity/config/oauth2_provider/override_return_to=false'
chilly-king-10285
08/28/2025, 1:47 PMchilly-king-10285
08/28/2025, 1:47 PMory patch project <project-id> --replace '/services/identity/oauth2_provider/override_return_to=true'
- Disable: ory patch project <project-id> --replace '/services/identity/oauth2_provider/override_return_to=false'
This setting is described in Identity Provider Integration Settings and is exposed in Console under OAuth 2 → Identity integration settings (“Enable Override Return To”). Disabling it should prevent Kratos from populating return_to from OAuth2 context. ([Identity integration settings](https://www.ory.sh/docs/oauth2-oidc/identity-provider-integration-settings#overview)). For completeness, the CLI patching approach and paths are consistent with the general project-config patching docs. ([Configure projects with Ory CLI](https://www.ory.sh/docs/guides/cli/config-with-cli)).handsome-agency-20541
08/28/2025, 1:53 PMchilly-king-10285
08/28/2025, 1:53 PMchilly-king-10285
08/28/2025, 1:53 PMory patch project <project-id> --replace '/services/identity/oauth2_provider/override_return_to=true'
- Disable: ory patch project <project-id> --replace '/services/identity/oauth2_provider/override_return_to=false'
This setting is documented as “Enable Override Return To” in Identity Integration Settings; the CLI path above is the supported alternative if the UI is unavailable in your Console environment (Go to OAuth 2 → Identity integration settings, or use the CLI patch shown in the docs) ([Identity integration settings](https://www.ory.sh/docs/oauth2-oidc/identity-provider-integration-settings#overview)).handsome-agency-20541
08/28/2025, 1:59 PMIt can be expected if your project/Console version doesn’t expose that page yet.Is there a rollout plan or something to consult with, regarding the console UI update? It’s quite inconvenient to have an administrative UI that does not match the docs.
chilly-king-10285
08/28/2025, 1:59 PMchilly-king-10285
08/28/2025, 1:59 PMory patch project <project-id> --replace '/services/identity/oauth2_provider/override_return_to=true'
- Disable: ory patch project <project-id> --replace '/services/identity/oauth2_provider/override_return_to=false'
([Identity integration settings](https://www.ory.sh/docs/oauth2-oidc/identity-provider-integration-settings#overview)). For updates on changes, Ory suggests monitoring the changelog and announcements: - changelog.ory.sh for Network updates ([Publish changelog of the sdks – comment](https://github.com/ory/network/issues/260)). - General troubleshooting and notices index also links to Identity Provider Integration Settings docs, but not to rollout timelines ([Troubleshooting index](https://www.ory.sh/docs/troubleshooting)).