How to fetch the "authentication" property of a User in the MSGraph API?

Thomas Balthazar 0 Reputation points


Using the Graph Explorer, I try to fetch the "authentication" property of a user, but I always get an empty result:$select=userPrincipalName,onPremisesUserPrincipalName,authentication


{     "@odata.context": "$metadata#users(userPrincipalName,onPremisesUserPrincipalName,authentication)/$entity",     "userPrincipalName": "<redacted>",     "onPremisesUserPrincipalName": "
" }

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":

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 "" returns a list of authentication methods.

Any idea?



Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,416 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 100.1K Reputation points MVP

    Use the /authentication/methods endpoint instead.

    0 comments No comments