Pass user identity from SPFx web part to Azure Web App and then call Microsoft Graph as this user

Deleted
Not applicable

Say I have an SPFx web part that needs to call a (to be created) REST API that's part of a web app hosted in Azure (middleware). This middleware in turn needs to call the Microsoft Graph as the current user. The middleware might make this call right away when receiving a request from the SPFx web part OR it might make multiple such calls in a timer-job-like fashion over a longer period of time. How would I build this?

 

The question is similar to this one: Pass user Identity from SPFX Webpart to Azure function

 

But I need to go this one step further delegating the user identity to Microsoft Graph, e.g. to get the tasks for the current user, the files shared with the current user or anything from the /me endpoint. The middleware then does some data aggregation, but always for a specific users's data.

 

I'm not sure which technical means and/or OAuth flows are suitable to reach this goal.

1 Reply
I hope we get an answer to this! I think it would be awesome, for instance, if we could call a PowerShell script hosted in azure from within a ListView command set. If I could do powershell instead of workflows my productivity would triple!

@Vesa can we get a demo on this topic