Please read through the full question before answering
The custom B2C policies that we develop when receiving an error redirects to the app based (redirect_uri) route - /error?error_code=.... We have multiple signup/signin policies for various sub-level organizations.
So we wrote a custom error page in our ASP.Net MVC app which is used for customizing B2C policy UI.
We have already looked at all stackoverflow answers related to b2c custom error messages and these URLs too: https://medium.com/the-new-control-plane/creating-an-error-page-for-an-azure-ad-b2c-custom-policy-flow-fb2692a3b50f
Even though on "api.error" content definition we define this new custom error page URL route, the policy is stopping at that page and just redirecting to the default route /error?error_code=....
Here is the content definition for "api.error" that we use:
<ContentDefinition Id="api.error">
<LoadUri>{ContentDefinitionBaseDomain}/DefaultError</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:contract:globalexception:1.1.0</DataUri>
<Metadata>
<Item Key="DisplayName">Error page</Item>
</Metadata>
</ContentDefinition>
If we browse to the DefaultError route, the page just renders fine.
It's just the policy which is NOT STOPPING at this custom error page and re-routing to the redirect_uri (target app) URL with error?error_code... route added to the end.
Any help is greatly appreciated.