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

Configuration in the code module

At the top of the code module, the variables TenantId, ClientId and ClientSecret must be set. The ClientId must be set to the Application (client) ID, ClientSecret to the secret generated, and TenantId to the Microsoft Azure Directory (tenant) ID.

private static readonly string TenantId = ""; private static readonly string ClientId = ""; private static readonly string ClientSecret = "";

On behalf of a user configuration

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_User and AzureAD_UserPwd must be set.

Related articles

Placeholder "LocalizeWeb2016" failed