Using Microsoft Graph API in a Web API without any

2020-04-27 12:29发布

问题:

Summary:

  1. I have a WinForms app where multiple users from my organization login to.
  2. From within this WinForm app, I want to call my Web API which internally processes some calendar related events (like create new meeting, fetch meeting responses, etc.) for precisely allotted MeetingManager user
  3. Here, we intend to use Microsoft Graph API to do all our stuff
  4. And since the Web API is going to handle this internally at its endpoint, we seek no interactive screen in between (neither for user login nor for granting permissions at consent page). All this should happen in background without any user interaction in between.
  5. How can I achieve this?

Note: I am a beginner to Microsoft Graph API and Web application domain

Graph API Mock up:

回答1:

You can get this by app-only authentication method. Get an app-only access token and use it for authentication.

I am also struggling on a similar type of question and I need to retrieve planner tasks. For planner tasks app-only scope is not supported but In your case I think it should work

Read both these links for more details.

https://graph.microsoft.io/en-us/docs/authorization/app_only

https://graph.microsoft.io/en-us/docs/authorization/permission_scopes