Is it possible to embed an iframe within a B2C custom website?

schegi 0 Reputation points
2024-03-20T09:42:00.2066667+00:00

I want to have an iframe besites my main login to show some advertising for my company
(like Salesforce here: https://login.salesforce.com/).

Now my html looks like this:

<body>
  <div id="content">
    <!-- Here is my whole b2c-content -->
    <div id="b2c-content">...</div>

    <!-- This is the iframe with the ad -->
    <iframe src="url" title="iFrame title"></iframe>
  </div>
</body>

My css and everything is working fine while testing, but when i upload it to my blob-storage in b2c and want to test it on the website, the iFrame is not shown. Also when I inspect the webpage, there is no iframe in the html-content. In the inspector it is looking like this:

<body>
  <div id="content">
    <!-- Here is my whole b2c-content -->
    <div id="b2c-content">...</div>
  </div>
</body>

Is there a good solution for this?

I also tried putting the iframe in a separate container but it didn't help.

Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Babafemi Bulugbe 4,025 Reputation points MVP Volunteer Moderator
    2024-03-20T10:54:41.1133333+00:00

    Hello @David Parth

    You can implement <iframe> HTML element to embed the sign-up or sign-in process into your web or single-page app. Please be informed that you can only do this using the custom policies.

    Login with hovering DIV experience

    Follow this link https://learn.microsoft.com/en-us/azure/active-directory-b2c/embedded-login?pivots=b2c-custom-policy to get the steps to complete this.

    Let me know if further assistance is required.

    Do accept the answer if this helps.


  2. schegi 0 Reputation points
    2024-03-20T12:02:36.8966667+00:00

    I just figured it out. It works after I added the following lines within the RelyingParty in my Custom Policy.

    <UserJourneyBehaviors>	
    	<ScriptExecution>Allow</ScriptExecution>
    </UserJourneyBehaviors>
    

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.