Azure AD B2C MFA saves phone number with incorrect format (without space)

s k 11 Reputation points
2021-03-10T16:09:59.67+00:00

Currently we trying to reset MFA in Azure B2C through Microsoft Graph API. The idea is to delete existing phone number in authentication methods, that at the next login user would be prompt for provide new one. We are using standard built-in user-flows for user login / registration.

The problem is that B2C during MFA registration stores phone number in authentication methods without space between country prefix and phone number (so in Azure Portal it’s +11112223333, and should be +1 1112223333). MFA works fine, but because of this:

  1. we are not able to query for phone number with Graph Api (https://learn.microsoft.com/en-us/graph/api/authentication-list-phonemethods?view=graph-rest-beta&tabs=http ) – GET returns empty array;
  2. we are not able to delete phone number with Graph Api (https://learn.microsoft.com/en-us/graph/api/phoneauthenticationmethod-delete?view=graph-rest-beta&tabs=http) – DELETE returns 404;

One workaround is POST new fake number with correct format through Graph Api and then delete it. Do you know is there better way to reset MFA or force B2C MFA to store phone number in correct format?

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

2 answers

Sort by: Most helpful
  1. Dallas Lopez 5 Reputation points
    2025-01-15T17:36:24.45+00:00

    This is still a known issue at Microsoft. I put in a ticket with them and they replied, stating that is a known bug with no timeline on a fix. This could have changed since I last spoke with them...

    In IEF, how I'm handling a workaround is with the following:

    First, write the user to the user to b2c, so that I have an object ID to work with. Then, create an app service (function in my case) with a restful endpoint. Pass the phone number - with proper formatting - and object ID to that restful endpoint using a rest technical profile. From there, make a graph call using the objectID for the user to the authenticationMethods and set the phone number there.

    This is the high level approach that has worked for me so far.

    1 person found this answer helpful.

  2. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2021-03-15T19:00:33.453+00:00

    Hi @s k , we have an issue ticket raised for this that we are working on. When it is finished we will let you know, hopefuly soon!

    Best,
    James


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.