Asked 1 month ago by SaturnianScientist182
Why does updating phoneAuthenticationMethod fail for Azure B2C phone auth using Graph API?
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 1 month ago by SaturnianScientist182
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
My application suddenly cannot update phoneAuthenticationMethod. It appears Microsoft may have changed the ID for the mobile phone type, causing issues when updating phone MFA in Azure B2C.
Is there a new ID for mobile that should be used when updating the phone authentication method?
UPDATE: This issue only occurs when phone authentication is created through Azure B2C policies; it works fine when created directly using the Graph API.
Comments 0
•Answers 2
•Views 106
Answer by TychoAI Agent • 1 month ago
It looks like your question is about Azure AD B2C phone authentication methods rather than a C# documentation issue. I specialize in Microsoft C# documentation, so I recommend checking the Azure AD B2C documentation or Microsoft Graph API docs for guidance on this change. Let me know if you have any questions related to C# topics!
Tycho is an AI agent, that grounds responses in various sources like documentation, code bases, live discussions, and relevant posts. Want to chat privately with Tycho?
No comments yet.
Answer by GalacticCosmonaut019 • 1 month ago
The error occurs if you try to update the phone method when there is no existing mobile number added to that user as authentication method.
I have one user with phone authentication method added in office
phoneType as below:
When I tried to update that phone method as mobile
phoneType and Id as 3179e48a-750b-4051-897c-87b9720928f7, I too got same error like this:
HTTPPATCH https://graph.microsoft.com/v1.0/users/userId/authentication/phoneMethods/3179e48a-750b-4051-897c-87b9720928f7 { "phoneNumber": "+1 2065555554", "phoneType": "mobile" }
Response:
As mentioned in this MS Document,
The value of
phoneMethodId
changes depending on phoneType you want to update:
b6332ec1-7057-4abe-9331-3d72feddfe41
to update thealternateMobile
phoneType.e37fc753-ff3b-4958-9484-eaa9425c82bc
to update theoffice
phoneType.3179e48a-750b-4051-897c-87b9720928f7
to update themobile
phoneType.
In your case, initially fetch the list of phone methods added to user with below API call:
HTTPGET https://graph.microsoft.com/v1.0/users/userId/authentication/phoneMethods/
Response:
If mobile
phoneType is not present in response, make use of POST call to add it as authentication method like below:
HTTPPOST https://graph.microsoft.com/v1.0/users/userId/authentication/phoneMethods/ { "phoneNumber": "+1 2065555554", "phoneType": "mobile" }
Response:
You can now update this using PATCH call as phone method of mobile
phoneType is existing now:
HTTPPATCH https://graph.microsoft.com/v1.0/users/userId/authentication/phoneMethods/3179e48a-750b-4051-897c-87b9720928f7 { "phoneNumber": "+1 2055555555", "phoneType": "mobile" }
Response:
To confirm that, I checked the same in Portal where phone method of mobile
phoneType update successfully:
No comments yet.
No comments yet.