Hi, get one method working at a time using the official B2C custom-policy samples, then combine them behind a simple “pick SMS or Authenticator” step. Known-good recipe: 1) Start from the “SocialAndLocalAccountsWithMfa” (phone/SMS) starter pack and the “LocalAccounts_TOTP” sample; upload Base/Extensions/RP files, create the two B2C apps (IdentityExperienceFramework + ProxyIdentityExperienceFramework) with API permissions and grant admin consent, and create the required policy keys (at minimum the SMS/MFA key and a TOTP encryption key). 2) Verify SMS first: in your Extensions file keep the built-in PhoneFactor technical profile; make sure you didn’t rename your tenant in the metadata, and that your MFA key exists; run the sign-in policy and confirm you receive and can verify the code. 3) Add TOTP: add an extension attribute to store the TOTP secret (e.g., extension_totpSecret) and copy the TOTP technical profiles and claims transformations from the sample (enroll = generate secret + show QR; verify = validate code); add orchestration steps that (a) if secret exists → verify, else → enroll; test end-to-end. 4) Combine methods: insert a DisplayControl (or a Boolean choice claim) step that lets the user pick SMS or Authenticator; use preconditions to branch to PhoneFactor or to the TOTP verify/enroll steps; persist the chosen method if you want a default next time. 5) Typical blockers: missing admin consent on the two B2C apps; missing policy keys; extension attribute not created (so writes to the directory fail); wrong tenant name/issuer in metadata; misordered orchestration steps; using “user flows” instead of “custom policies”; or no Application Insights hooked to IEF (enable it and read the detailed exception to see exactly which TP/CT failed). If you paste your current Extensions/RP snippets (the PhoneFactor TP, the TOTP TPs/CTs, and the orchestration steps) I can pinpoint the exact fix, but following the sequence above with the official samples almost always gets SMS and TOTP working in under an hour.
Azure AD B2C Integration SMS and TOTP using Custom policy
Kakadiya, Neel
0
Reputation points
I'm trying to create a custom policy for integrating SMS and TOTP using a Custom policy. But I looked at the Medium post and coding post, but it is still not working. Not sure where I'm going wrong.
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.