<@U04UQ68083H> How do I change the default URL aft...
# ory-copilot
b
@chilly-king-10285 How do I change the default URL after OIDC login? Right now it's going to our Ory Network address.
c
A message from kapa.ai
To change the default URL after an OpenID Connect (OIDC) login, you can utilize the
--default-redirect-url
flag with the
ory
command. This allows you to specify a custom URL to which users will be redirected after login, instead of the default Ory Network address. Here's how you can do it:
Copy code
bash $ ory --project <your-project-slug> \    --default-redirect-url /welcome \    <http://127.0.0.1:3000> \    <https://ory.example.org>
In this example, after login, users will be redirected to
/welcome
on your specified domain (
<https://ory.example.org>
) instead of the default Ory Network address. For more details, you can refer to the documentation on [ory proxy redirects](https://www.ory.sh/docs/cli/ory-proxy#redirects).
b
@chilly-king-10285 No, not with ory tunnel, but on our deployed application.
c
A message from kapa.ai
To change the default URL after an OIDC login for your deployed application, you need to update the
base_redirect_uri
in your Ory configuration. This setting applies to all social sign-in providers and cannot be changed on a per-provider basis. Here's how you can update it using the Ory CLI:
Copy code
bash ## List all available projects   ory list projects      ## Add OIDC base redirect URI   ory patch identity-config <project-id> \    --add '/selfservice/methods/oidc/config/base_redirect_uri="<https://ory.example.org>"'
By executing the above commands, you change the redirect URL to your custom domain (
<https://ory.example.org>
in this example). This change affects the OIDC flow, ensuring that after a successful login, users are redirected to the specified custom domain instead of the default Ory Network address. Please note, changing the
base_redirect_uri
will break previously existing and functional social sign-in connections because Ory Identities will initiate the OIDC flow with the new redirect URL. For more detailed information, you can refer to the documentation on [setting a custom domain as the redirect URL](https://www.ory.sh/docs/identities/sign-in/social-sign-in/redirect-url).
b
@chilly-king-10285 No, I mean after the user has logged in. If we change base_redirect_url, our flow won't work (this needs to be our Ory URL, not our UI URL). I want to redirect after OIDC log in to our UI URL.
c
A message from kapa.ai
I understand now, you're looking to redirect users to a specific URL after they have successfully logged in via OIDC, without altering the
base_redirect_uri
which is crucial for your flow to work correctly. Based on the extracts provided, there isn't a direct mention of configuring post-login redirects specifically for OIDC logins to a custom UI URL within the provided documentation excerpts. However, a common approach in OIDC flows involves using the
state
parameter or configuring the client application to handle redirects after authentication. Typically, the
state
parameter can carry information about the intended final destination URL, and the client application can use this to redirect the user accordingly after the login process completes. This method ensures that the user lands on the desired page within your application after logging in. For Ory configurations and flows, if you're looking to implement or adjust such behavior, it would usually involve setting up your client application to handle the redirect based on the OIDC response. Since the specific method to achieve this with Ory based on the provided extracts isn't available, I recommend consulting the Ory documentation or community for guidance on implementing post-login redirects to your UI URL within the context of your Ory OIDC setup. For more detailed guidance and best practices on handling redirects and integrating with your UI, the Ory documentation and community forums can be valuable resources: - [Ory Documentation](https://www.ory.sh/docs) - [Ory Community Forum](https://community.ory.sh/) These resources may offer insights or examples relevant to your specific use case and Ory's capabilities for handling post-login redirects in OIDC flows.