Exemple #1
0
 private GraphServiceClient GetGraphServiceClient(string[] scopes)
 {
     //Ask the Graph Factoy to create a GraphServiceAPI client. Using the token of the user that is logged in authorized
     return(GraphFactory.GetAuthenticatedGraphClient(async() =>
     {
         //Uses project Microsoft.Identity.Web to get the token
         string result = await tokenAcquisition.GetAccessTokenForUserAsync(scopes);
         return result;
     }, webOptions.GraphApiUrl));
 }