Confused about Microsoft "signed in user" and IIS app pool identify

Luan-i Jackson 40 Reputation points
2023-04-12T16:29:45.63+00:00

I have a ASP.NET MVC hosted on premise that uses Windows Authentication. It also utilizes a service account for its app pool identity that has heightened privileges for various tasks such as database accesses. In this app, I would like to utilizes Microsoft Graph for various tasks, such as getting information about AD and organization hierarchy (who are the members of an AD group, who are the direct reports, creating calendar events, etc). I've been looking through various documentation but still confused about authorization and authentication in Graph.

  1. In web applications that utilizes app pool identity and windows authentication, what exactly is the "signed in user" to Microsoft Graph? Is it the actual user that sign in to the MVC app, or is it the identity in App Pool?
  2. This web app needs to have heightened privileges above any regular logged in users, such as creating tasks or calendar events for multiple users without those users' specific consent. Do I elevate that identity so it has all heightened privileges or do I use Application permissions?
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,283 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,057 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,363 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 59,051 Reputation points
    2023-04-12T16:45:51.82+00:00

    the GraphApi uses a jwt bearer access token you get by calling the azure oauth server. It does not use windows authentication. the "signed in user" is the use defined in the acc css token.

    if your website use azure ad oauth, you could have an access token that represented the user. In you case you will probably create an application id, and secret used by the server application to get an access token. you will assign a service account to this azure ad application when you grant it graph api access. this account will be the "signed in user"

    https://learn.microsoft.com/en-us/graph/auth-v2-service

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful