Azure AD B2C CrossOriginException despite CORS being configured
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.