acmichaud's avatar
acmichaud
Copper Contributor
Aug 08, 2022
Status:
Completed

Impossible to get the phone when it is added from B2C

Hi there,

 

This was originally posted there : https://github.com/microsoftgraph/msgraph-beta-sdk-dotnet/issues/506
But they asked me to post it here. This is more a bug than a request for a feature.

 

 

I'm having an issue where the graphAPI returns an empty array when I call this endpoint

/users/{id}/authentication/phoneMethods

Here is the query
`https://graph.microsoft.com/beta/users/da07b4a6-****-****-****-*********1d0/authentication/phoneMethods`

The result

 

 

 

 

"@odata.context": "https://graph.microsoft.com/beta/$metadata#users('da07b4a6-****-****-****-*********1d0')/authentication/phoneMethods",
"value": []

 

 

 

 

Of course, the user has a phone attached to his MFA.

 

 

There is also this thread on StackOverflow that says that the issue is the phone format.

https://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F65200556%2Fbug-identified-in-azure-b2c-mfa-phone-number-format-missing-spaces&data=05%7C01%7Ca.chagnon.michaud%40lifeworks.com%7C7345b046306a460f0b5d08da76583d28%7C7565b51c5e8748ebbc80252b20bc1ade%7C1%7C0%7C637952418639770899%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hQFvdbRUgMh0bxboPLAf4kYXWfvRZvu%2FWrEs%2B1wxCGU%3D&reserved=0

So I tried to add the space

 

And now it works.

 

 

 

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('da07b4a6-****-****-****-*********1d0')/authentication/phoneMethods",
    "value": [
        {
            "id": "----",
            "phoneNumber": "+1 4************",
            "phoneType": "mobile",
            "smsSignInState": "notAllowedByPolicy"
        }
    ]
}

 

 

 

Is it possible to fix this issue?

Thanks!

3 Comments