Azure AD B2C Custom Policy: Potential bug when handling the send verification code response

Pierre-Olivier Veilleux 6 Reputation points
2021-03-16T20:53:59.69+00:00

I have a custom policy that allows me to create users in my Azure B2C directory. In this policy I have modified the display control to send emails following this article:
https://learn.microsoft.com/en-us/azure/active-directory-b2c/custom-email-sendgrid

From time to time, I get this JavaScript error when clicking on the Send code button:

ReferenceError: isMessageSafe is not defined  
    at Object.changeVerificationControlState  

Looking at the JavaScript code in my browser (using the prettified version provided by Chrome), I see this code, but the isMessageSafe variable does not seem to be sent anywhere, which would explain the JavaScript error

changeVerificationControlState: function(n, t, u, f) {  
  // ...  
  switch (t) {  
      // ...  
      case r.FAILED_TO_SEND:  
          u && ($(e).attr("aria-label", u),  
          isMessageSafe ? $(e).html(u) : $(e).text(u));  
          i.showElementsAndEnableControls(s, [o, y, e], h, l);  
          break;  
      // ...  
    }  
}  

Here is the content definition for the api.localaccountsignup I use for account sign up

<ContentDefinition Id="api.localaccountsignup">  
  <LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>  
  <RecoveryUri>~/common/default_page_error.html</RecoveryUri>  
  <DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.2</DataUri>  
  <Metadata>  
    <Item Key="DisplayName">Local account sign up page</Item>  
  </Metadata>  
</ContentDefinition>  

Thank you!

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,752 questions
{count} vote

1 answer

Sort by: Most helpful
  1. James Hamil 22,981 Reputation points Microsoft Employee
    2021-03-22T19:37:43.907+00:00

    Hi @Pierre-Olivier Veilleux , can you try updating the selfasserted version to 2.1.1 or 2.1.0 in the <DataUri> element and check if that works or not?

    <DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.2</DataUri>  
    

    Please let me know if this works. If so, please mark this answer as "Verified" so other users may reference it.

    Best,
    James

    0 comments No comments