Skip to content
Advertisement

Get user details with Azure Auth MFA – Multi factor authentication

I am trying to use Azure Auth MFA for my PHP application, everything seems to be working fine and I get True returned when I echo $result at the end of script. But how do I get user details from here, for example the users login ID, AD ID

I have tried client principal name, but it does not return anythin

JavaScript

PFB full code

JavaScript

print_r($jsonoutput) //looks good

JavaScript

Advertisement

Answer

In fact you can directly replace $url = "graph.microsoft.com"; with $url = "https://graph.microsoft.com/v1.0/me"; to get the user information.

Parsing the access token can also get user details (adding X-MS-CLIENT-PRINCIPAL-NAME as a request header).

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement