Microsoft Graph - Retrieve admin details after granting consent?

Wilson Song 21 Reputation points


I'm currently using the client_credentials flow to get consent for my application.
But since this only allows me to use endpoints with application permission, I can't use the /me endpoint to retrieve the user that granted the consent.

Is there any other way to get the details (email, name, etc.) of the admin that granted the consent? Even if it means making multiple other requests?

Microsoft Graph Users API
Microsoft Graph Users API
A Microsoft API that allows you to build compelling app experiences based on users, their relationships with other users and groups, and the resources they access for example their mails, calendars, files, administrative roles, group memberships.
653 questions
No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 20,956 Reputation points

    Hi @Wilson Song

    If you are using the unattended client credential flow then you will not be able to get the logged in admin details. Unless you know your administrator's user id, then call /users/{user id} endpoint.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    No comments

0 additional answers

Sort by: Most helpful