Search code examples
sendgridazure-ad-b2c-custom-policy

Azure AD B2C using custom HTML to request OTP verification via SendGrid


I'm using Azure AD B2C / IEF Custom Policies. As part of my Password Reset user journey, I want to use SendGrid to handle the email for the OTP / verification code. I also want to use custom HTML templates for the password reset page(s). The Azure docs give a good example for using SendGrid... BUT it uses DisplayControl elements to format the password reset page and it's not immediately obvious how to augment or replace the DisplayControl element to instead use Custom HTML.

Did anyone manage to get this working? Any pointers?

TIA

EDIT: Is it simply a case of adding a LoadUri element to the ContentDefinition that contains the DataUri?


Solution

  • Actually, it turns out that the DisplayControl works fine. It forms part of the HTML that is dynamically generated and injected into the Custom Template HTML ("App" element) by B2C.

    Initially I was getting Server 500 errors from B2C, which lead be to believe there was a problem with the approach - but the I found the source of the errors elsewhere and once fixed, the DisplayControl components worked pretty seemlessly