We are getting the following error when trying to get to Umbraco backoffice.
We have added the env variable of:
Umbraco__CMS__WebRouting__UmbracoApplicationUrl
Is there something else we are missing?
Happens both locally and in the web app in azure.
error:invalid_request
error_description:The specified 'redirect_uri' is not valid for this client application.
error_uri:https://documentation.openiddict.com/errors/ID2043
When Umbraco boots, it adds a redirect_uri in the database based on the request. This database record is used for validating OAuth. If this is set incorrectly, or you change the hostname later, or have multiple Umbraco instances look at the same database, you can get this error. It’s really annoying, but redirect_urls are required for OAuth. I think you also need to set the BackOfficeHost…? Not sure though.
So when a user logs in for the first time, redirect_uri is set and any subsequent login from a different domain will cause this error. I think you can find the record in one of the umbracoOpenIddict* database tables and update it manually.
Don’t exactly know what it is needed for but it’s related to having a hostname added to your site, localhost should work but a “real” hostname sometimes needs extra config (something like that, I can’t remember exactly).
Absolutely! I have the same issue when using a deployment slot in Azure, because in that case, two Umbraco instances with different URLs connect to the same database and Umbraco will only register one domain automatically.
Fortunately, the redirect_urls property in the database is an array, so you can actually manually add entries to it.