Invalid Content-Security-Policy Header when using Custom Policy with JourneyFraming

StefanWHel 1 Reputation point
2022-06-16T11:16:55.467+00:00

I'm looking into embedding the Azure AD B2C sign-in page in an Iframe in my SPA. Following the documentation, I have added my domains (MYDOMAIN1, MYDOMAIN2) in the JourneyFraming element of my Custom Policy. The authentication works - however, there are a number of errors in my browser's console that stop me from going to production with this solution. One error in particular is this:

The Sign-In page (/authorize) returns the following invalid HTTP Header:

Content-Security-Policy: script-src 'strict-dynamic' 'self' 'nonce-6MJayq01+GIeI1e4EsWB0w==' 'report-sample'; report-uri /MYTENANT.onmicrosoft.com/B2C_1A_MYPOLICY/client/cspreport?p=B2C_1A_MYPOLICY frame-ancestors https://MYDOMAIN1.COM https://MYDOMAIN2.COM  

According to MDN, the directives must be semicolon-separated. The semicolon is missing after the 'report-uri' directive, though.

This leads to a HTTP POST of the CSP Report to each of those URLs:

This is a very ugly bug - unless I'm doing something wrong?
The relevant config in the Custom Policy is:

  <RelyingParty>  
    ...  
    <UserJourneyBehaviors>  
      <JourneyFraming Enabled="true" Sources="https://MYDOMAIN1.COM https://MYDOMAIN2.COM" />  
    </UserJourneyBehaviors>  
Microsoft Security | Microsoft Entra | Microsoft Entra External ID
{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.