Azure AD B2C CrossOriginException despite CORS being configured

Chris Beer 0 Reputation points
2025-01-22T12:18:04.0633333+00:00

Hi all

We are seeing a significant number of exceptions being logged to App Insights by our Azure AD B2C custom policies.

Microsoft.Cpim.UserExperience.Client.CrossOriginException

The resource 'https://xxx/xxx.html' contains script errors preventing it from being loaded.

The issue seems to be intermittent as the vast majority of users are able to sign in successfully. We can see a similar error message in the logs of some of our relying parties, indicating it is being sent in the response by Azure AD B2C, so seems likely that this manifests as a visible issue when it occurs.

Our UI templates are hosted in a storage account, and the CORS policy is configured as per Microsoft documentation. We have also confirmed that the templates do not contain any script errors.

Having reviewed the obvious things and having no success we are now left scratching our heads. If anyone is able to offer any insights on what might be the potential cause these would be gratefully received.

Thanks in advance.

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
3,011 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.