Microsoft Graph - Retrieve admin details after granting consent?

Wilson Song 21 Reputation points
2022-02-08T06:53:00.197+00:00

Hello,

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
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,771 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 37,466 Reputation points
    2022-02-08T07:41:53.363+00:00

    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.
    0 comments No comments

0 additional answers

Sort by: Most helpful