Use the /authentication/methods endpoint instead.
GET https://graph.microsoft.com/beta/me/authentication/methods
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
Using the Graph Explorer, I try to fetch the "authentication" property of a user, but I always get an empty result:
returns:
{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(userPrincipalName,onPremisesUserPrincipalName,authentication)/$entity", "userPrincipalName": "<redacted>", "onPremisesUserPrincipalName": "
<redacted>
" }
If I add "&$expand=authentication" at the end of the URL, I get this error:
{
"error": {
"code": "UnknownError",
"message": "{\"ErrorCode\":\"badRequest\",\"Message\":\"Resource not found for segment 'users('redacted')'.\",\"Target\":null,\"Details\":null,\"InnerError\":null,\"InstanceAnnotations\":[],\"TypeAnnotation\":null}",
"innerError": {
"date": "2024-07-02T11:58:47",
"request-id": "5417b491-c30a-4c4b-8875-dd26aac48652",
"client-request-id": "3bcfde08-8c2b-e491-d48a-9dc3fc195dbe"
}
}
}
which is kind of expected since the documentation doesn't list the "authorization" as "expandable": https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#relationships
But then, why does the "authentication" always returns an empty value. Is this a bug in the API or am I missing something?
The app I use to query the API has "User.Read.All" and "UserAuthenticationMethod.Read.All", it always gets an empty "authentication" property when trying to list users. But getting "https://graph.microsoft.com/v1.0/me/authentication/methods" returns a list of authentication methods.
Any idea?
Thanks!
t.
Use the /authentication/methods endpoint instead.
GET https://graph.microsoft.com/beta/me/authentication/methods