Exception in custom Azure User Flows

Emanuel Borsoi 156 Reputation points

I am trying to custmoize the User Flows (Policies) by changing the Page layout. I followed this example, first putting my html file on a public folder on my webspace, then also setting up the Blob Storare and CORS (Tested with test-cors.org). In both cases, once I set the Custom page URI, when I Run user flow I get the following exception:

ArgumentException: An item with the same key has already been added. Key: MicrosoftIdentityError  
System.Collections.Generic.Dictionary<TKey, TValue>.TryInsert(TKey key, TValue value, InsertionBehavior behavior)  
System.Collections.Generic.Dictionary<TKey, TValue>.Add(TKey key, TValue value)  
Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary.Add(string key, object value)  
Microsoft.Identity.Web.TempDataLoginErrorAccessor.SetMessage(HttpContext context, string message)  
Microsoft.Identity.Web.AzureADB2COpenIDConnectEventHandlers.OnRemoteFailure(RemoteFailureContext context)  
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)  
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)  

If I load it through my DemoApp I get the following error:

Message contains error: 'server_error', error_description: 'AADB2C90047: The resource 'https://emab2cblobstorage.blob.core.windows.net/root/customize-ui.html' contains script errors preventing it from being loaded. Correlation ID: ba1a35d8-4727-4a2a-b06e-30a5ca7a9ea1 Timestamp: 2021-03-15 13:49:30Z ', error_uri: 'error_uri is null'.  

Don't find any help on the web.

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.
2,754 questions
0 comments No comments
{count} votes

Accepted answer
  1. AmanpreetSingh-MSFT 56,486 Reputation points

    Hi @Emanuel Borsoi · Thank you for reaching out.

    Above error occurs due to improper CORS settings configured under storage account where the html file is hosted. You need to configure https://Your_B2C_Tenant.b2clogin.com as Allowed origins. Please refer to below screenshot and update your CORS settings:



    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

0 additional answers

Sort by: Most helpful