Pims R4 Dev have an example code module "api/graphapiauthentication" that will authenticate against the Microsoft Graph API and provide an Access Token that you need in order to integrate against for example the One Drive service. This code module uses the "on behalf of a user" concept. The Microsoft Graph Documentation can be viewed here , Note that if the client is using Federation Active Directory Services the "on behalf of a user" is not supported, then you will need to use the "in user context" concept and see the example Web application in Pims R4 Dev, see the documentation here
At the top of the code module, the variables
ClientSecret must be set.
ClientId must be set to the Application (client) ID,
ClientSecret to the secret generated, and
to the Microsoft Azure Directory (tenant) ID.
The Code Module will request an access token, called Bearer, from the Microsoft Graph API. This access token is needed to every call you are going to do againts the Graph API and it will expire and needs to be re-newed. The variables
AzureAD_UserPwd must be set.
Placeholder "LocalizeWeb2016" failed