ory / network

Ory runs a global end-to-end security infrastructure for humans, robots, and servers. We build and use open source software.
Apache License 2.0
81 stars 6 forks source link

Configure browser redirects per custom domain #374

Open BrandonNoad opened 9 months ago

BrandonNoad commented 9 months ago

Preflight checklist

Ory Network Project

dazzling-chandrasekhar-msru5m4b1c

Describe your problem

On the Account Experience > Browser redirects page, you can configure the redirect settings for your Ory project.

There are no issues if you use the default project URL or only have a single custom domain.

But if you have multiple custom domains, then configuring the redirects may be problematic.

Path values are limited since, if the redirect value is a path instead of a full URL, the path is relative to the project URL and not the Custom UI base URL. Since you can't host pages under the project URL (even with a custom domain), you'll likely need to set the redirect value using a full URL. But if you have multiple custom domains, then the full URL may not work with all of the custom domains.

Describe your ideal solution

Similar to the Account Experience > UI URLs page where you set the Custom UI Base URL and flow UI values separately for each custom domain, you should be able to set the redirects separately for each custom domain. Or at least be able to set a custom base URL for each custom domain, and then path redirect values should be relative to the base URL.

Workarounds or alternatives

Right now I am setting a return_to value in my code when there isn't already one specified, which can be dynamic based on where the code is running

Version

Ory Network

Additional Context

No response

aeneasr commented 9 months ago

Hey Brandon, I think that makes sense! Currently, multi-domain system is making it complicated to do what you're asking. We have it on the backlog to improve this architecture which would allow changes like the one you mentioned. Unfortunately, that's not going to happen soon as it's a quite complicated process to ensure there are no breaking changes.

BrandonNoad commented 9 months ago

No rush @aeneasr, it is not an urgent request. But I had noticed the limitation and wanted to jot it down.