Skip to content

Application URLs: Prevent back office hosts being overwritten in a shared database setup (closes #16741)#22160

Merged
AndyButland merged 2 commits intoumbraco:mainfrom
matthewcare:temp/16741-shared-database-multiple-instance
Mar 19, 2026
Merged

Application URLs: Prevent back office hosts being overwritten in a shared database setup (closes #16741)#22160
AndyButland merged 2 commits intoumbraco:mainfrom
matthewcare:temp/16741-shared-database-multiple-instance

Conversation

@matthewcare
Copy link
Copy Markdown
Contributor

Fix for #16741

Testing instructions:
Replicate the issue as detailed here:
#16741 (comment)

Without this change, you will receive the error

error:invalid_request
error_description:The specified 'redirect_uri' is not valid for this client application.
error_uri:https://documentation.openiddict.com/errors/ID2043

With this patch, you should be able to log in on each instance without issue.

Something to consider (as also mentioned in the issue comments), is that now we're just continually adding to the array with no way to clear it, we could end up with stale URIs in the database. This might be a concern if you change domain names, whereby the old domain is never cleared from the database.

Add to backoffice hosts, rather than completely replacing the array
@github-actions
Copy link
Copy Markdown

Hi there @matthewcare, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@AndyButland
Copy link
Copy Markdown
Contributor

AndyButland commented Mar 17, 2026

Thanks for this @matthewcare - your fix looks like the right approach to me, though we need to consider the point you raise about old domains no longer getting cleared. I've just pushed up a couple of unit tests to verify it. I'll see about getting it reviewed tomorrow.

@AndyButland AndyButland changed the title Prevent back office hosts being overwritten in a shared database setup Application URLs: Prevent back office hosts being overwritten in a shared database setup (closes #16741) Mar 19, 2026
@AndyButland AndyButland merged commit f27e5a1 into umbraco:main Mar 19, 2026
27 checks passed
AndyButland added a commit that referenced this pull request Mar 19, 2026
…ared database setup (closes #16741) (#22160)

* Add to backoffice hosts

Add to backoffice hosts, rather than completely replacing the array

* Add unit tests verifying fix.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants