Getting profile during admin consenting in nodejs

Mubashar Hussain 0 Reputation points
2024-01-04T06:53:54.5933333+00:00

Hi Community,

I am Mubashar a full stack javascript developer. I am doing admin consent with a multitenant Azure app in Nodejs with the blow URL

        `https://login.microsoftonline.com/common/adminconsent?grant_type=client_credentials&client_id=${process.env.MICROSOFT_APP_ID}&state=${state}&redirect_uri=${process.env.REDIRECT_URI}`

admin consent is successfully returned in my app on the given redirect uri but the profile of admin user is not getting for some reason. I would like to have the user details and tenant details of who has consented. I tried with the /me route from graph API but /me is for delegated users. Please help if I am doing wrong somewhere I will be very thankful.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Deepanshu katara 16,720 Reputation points MVP Moderator
    2024-01-04T10:08:50.04+00:00

    Hi @Mubashar,This is not possible, you cannot know which admin provided consent. Its always the consentType Admin with no user details.
    There is no specific entity which will tell you more about the admin. The userobjectID always comes empty. Please accept answer if it has helped , Thanks

    User's image


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.