Azure B2C Custom policies MFA OTP via Email customization

Gola, Mariusz 45 Reputation points
2025-03-27T12:39:59.2+00:00

Hi,

Thank you in advance.

We are implementing Azure B2C email MFA via OTP using custom policies. Everything works as expected with the out the box functionality but now the business is looking to make some changes to make this process easier.

They would like to eliminate "Send verification code" button click and auto-send the verification code, vs having to click it . See image below.

1.) Is this possible using custom policies and some custom JS?

2.) Please provide any guidance, links or sample code to accomplish this?

How to auto-send the verification code?

User's image

thank you

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
24,169 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kancharla Saiteja 2,920 Reputation points Microsoft External Staff
    2025-03-31T23:59:47.3233333+00:00

    Hi @Gola, Mariusz,

    Based on your query, here is my understanding: You would like to auto generate the SMS verification code for Azure AD B2C using custom policies.

    Azure AD B2C two-step verification works with two technical profiles, "Generate code" and "Verify code". As you would like to auto generate the code without clicking on any button which may not be possible to perform using any custom policy. Azure AD B2C do not have any kind of customization that can help you in generating a verification without clicking on "Send Verification Code".

    Here are the available features for customization using JavaScript: Enable JavaScript and page layout versions in Azure Active Directory B2C.

    Customize template for MFA using html

    I hope this information is helpful. Please feel free to reach out if you have any further questions.

    If the answer is helpful, please click "Accept Answer" and kindly "upvote it". If you have extra questions about this answer, please click "Comment"


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.