title: Exception in custom Azure User Flows
body: <p>I am trying to custmoize the <em>User Flows (Policies)</em> by changing the <em>Page layout</em>. I followed <a href="https://docs.microsoft.com/it-it/azure/active-directory-b2c/customize-ui-with-html?pivots=b2c-user-flow#custom-html-and-css-overview" rel="nofollow noreferrer">this</a> example, first putting <a href="https://emab2cblobstorage.blob.core.windows.net/root/customize-ui.html" rel="nofollow noreferrer">my html</a> file on a public folder on my webspace, then also setting up the Blob Storare and CORS (Tested with <a href="https://www.test-cors.org/#?client_method=GET&amp;client_credentials=false&amp;server_url=https%3A%2F%2Femab2cblobstorage.blob.core.windows.net%2Froot%2Fcustomize-ui.html&amp;server_enable=true&amp;server_status=200&amp;server_credentials=false&amp;server_tabs=remote" rel="nofollow noreferrer">test-cors.org</a>).
  In both cases, once I set the <em>Custom page URI</em>, when I <em>Run user flow</em> I get the following exception:</p>
  <pre><code>ArgumentException: An item with the same key has already been added. Key: MicrosoftIdentityError
  System.Collections.Generic.Dictionary&lt;TKey, TValue&gt;.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
  System.Collections.Generic.Dictionary&lt;TKey, TValue&gt;.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.Identity.Web.MicrosoftIdentityWebAppAuthenticationBuilderExtensions+&lt;&gt;c__DisplayClass5_2+&lt;&lt;AddMicrosoftIdentityWebAppInternal&gt;b__5&gt;d.MoveNext()
  Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler&lt;TOptions&gt;.HandleRequestAsync()
  Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
  Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
  </code></pre>
  <p>If I load it through my DemoApp I get the following error:</p>
  <pre><code>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'.
  </code></pre>
  <p>Don't find any help on the web.</p>
  <p>Edit:<br/>
  This are the Azure CORS settings:</p>
  <p><a href="https://i.stack.imgur.com/7r91Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7r91Q.png" alt="enter image description here" /></a></p>