Search code examples
azureworkflowmicrosoft-graph-apioffice365api

Microsoft Graph and accepted by admin required


I need to have the following workflow:

  1. Third-party company registers new admin user for Office365 (I can't control this process).
  2. Then pass credentials of this user to us and we configuring it (add domains, additional users etc).
  3. I need to automate this process and this should be done by background task. So, after registration we catch this event and add message to queue and then our Azure Functions add domains, register new users etc.

But for calling Microsoft Graph admin have to accept permissions manually (go to web page and accept). Without this action token is not valid. And it breaks our automate process :(

Any way to accept it without going to web page and logging by admin for accepting?


Solution

  • From how you describe this process it seems like what you really need is to create an application that uses Application Only permissions that your customer grants consent too. There should be no need for them to manually create an admin user and give you credentials for this user.

    And to specifically answer your question, I do not believe there is anyway to automate the user consent process via an API call. That would defeat the purpose of user consent.