Graph API, returns Unauthorized : User not found

Dominik 5 Reputation points
2024-07-22T20:29:49.46+00:00

Hello all,

I develop an app which uses delegate permission to read a users presence. This all worked fine while using my Developer Subscription. After it has been expired I bought the 'Azure Active Directory Premium P1' license to simulate organizational users and test my app.

I can successfully obtain an access token, but requesting the user presence (Presence.Read) always results in this error:

{"error":{"code":"Unauthorized","message":"User not found","innerError":{"date":"2024-07-22T19:49:43","request-id":"...","client-request-id":"..."}}}
flutter: 401

This error happens when I login as admin and as another user of my organization. Info: When logging in to my account I granted permission of this app for all users of my organization.

This is my Entra ID:User's imageAnd for my App Registration in Azure I use another email account not related to the Entra ID. Related to that ticket, no license or anything is needed for this service: https://learn.microsoft.com/en-us/answers/questions/1111512/application-registration-costUser's image

Microsoft Security Microsoft Entra Microsoft Entra ID
Microsoft Security Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,371 Reputation points
    2024-07-23T09:56:16.0233333+00:00

    Hi @Dominik

    P1 licenses are not available for the /me/presence endpoint, this resource currently only supports Microsoft Teams users.

    You should subscribe to an MS 365 license for your organization as it includes the Teams service, and then assign that license to the logged-in user.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.