cold-scientist-93808
08/27/2024, 3:12 PMchilly-king-10285
08/27/2024, 3:12 PMchilly-king-10285
08/27/2024, 3:13 PMyaml selfservice: flows: registration: after: default_browser_return_url: <https://end-up-here-after-registration/>
This configuration will redirect the user to <https://end-up-here-after-registration/>
after successful registration. For OpenID Connect (OIDC) specifically, when you are self-hosting Ory Kratos and adding a social sign-in provider, you need to define a redirect URL following this pattern: http http(s)://<domain-of-ory-kratos>:<public-port>/self-service/methods/oidc/callback/<social-signin-provider-id>
This URL is where the user will be redirected after successful authentication with the OIDC provider. Please note that if you want to redirect someone back to the original URL after registration, you can append ?return_to=<original-url>
when initializing the Registration flow. However, to prevent Open Redirect Attacks, you need to whitelist the domain in your Ory Kratos config when using the ?return_to=
query parameter. Here is an example of how to add a domain to the whitelist: yaml selfservice: allowed_return_urls: - <https://www.myapp.com/>
In this example, <https://www.myapp.com/>
is added to the whitelist, allowing you to specify a dynamic return URL like ?return_to=<https://www.myapp.com/blog/write>
. For more details, please refer to the [Ory Kratos Documentation](https://www.ory.sh/docs/kratos/concepts/browser-redirect-flow-completion#redirection).cold-scientist-93808
08/27/2024, 3:15 PMchilly-king-10285
08/27/2024, 3:15 PMchilly-king-10285
08/27/2024, 3:15 PMdefault_browser_return_url
under the registration
flow in the configuration file. Here is an example: yaml selfservice: flows: registration: after: default_browser_return_url: <https://end-up-here-after-registration/>
This configuration will redirect the user to <https://end-up-here-after-registration/>
after successful registration. However, please note that this configuration will apply to all registration methods, not just OIDC. Currently, Ory Kratos does not support setting a different redirect URL for each registration method. For the OIDC provider specifically, you need to define a callback URL when you set up the provider. This URL is where the user will be redirected after successful authentication with the OIDC provider: http http(s)://<domain-of-ory-kratos>:<public-port>/self-service/methods/oidc/callback/<social-signin-provider-id>
This URL is not the same as the redirect URL after registration. The callback URL is used to handle the response from the OIDC provider, while the redirect URL after registration is where the user is sent after the entire registration process is completed. For more details, please refer to the [Ory Kratos Documentation](https://www.ory.sh/docs/kratos/concepts/browser-redirect-flow-completion#redirection).