Problem:
I had the need to give our users a way, to register external users through the SharePoint interface for a custom solution also based on SharePoint.
It was a little bit tricky to get a token from Graph to use it in the next action.
To save your time, I document it here…
Solution:
- register an app on https://apps.dev.microsoft.com/
make sure, you grant the application appropriate permissions in Azure AD. In my case it was “User.ReadWriteAll” (application permission!)
then generate a password and also note down the application ID (you need it later);
in Azure AD grant the application the admin consent for the permissions! - In Flow add an action “HTTP Request”
Note that the body content must be URL encoded
- Now you have to get the token out of the response;
use the action Initialize Variable and a custom expression
(where ‘GetAccessToken’ is the name of the action from before!) - again use an action HTTP Request to do the POST