Search code examples
microsoft-graph-apimicrosoft-graph-sdks

How to get phone number from users 2FA using Graph SDK?


I have a MS Graph SDK v4.7

I need to get users phone number that is used in 2FA against ADB2C.

In documentation, I can see:

graphClient.user[id].Authentication.PhoneMethods...

but there is no such property in my version of the Graph SDK. All there is is:

graphClient.user[id].Authentication.Methods...

but that one doesn't contain anything related to phones.

Am I missing something? How to get the phone number used for 2FA?


Solution

  • Probably need to update at least to SDK v4.35 which is the first version that contains authentication phone methods.

    AuthenticationRequestBuilder

    SDK v4.7 doesn't have a request builder for phone methods and related model.