Код: Выделить всё
IConfidentialClientApplication app = ConfidentialClientApplicationBuilder.Create(clientId).WithClientSecret(clientSecret).WithAuthority(new Uri($"https://login.microsoft.com/{tenantId}")).Build();
string[] scopes = new[] { "https://graph.microsoft.com/.default" };
AuthenticationResult result = await app.AcquireTokenForClient(scopes).ExecuteAsync();
string accessToken = result.AccessToken;
string documentLibraryName = "Documents";
string retentionLabelName = "Retain EUTS";
GraphServiceClient graphClient = new GraphServiceClient(new DelegateAuthenticationProvider((requestMessage) => {
requestMessage.Headers.Authorization = new AuthorizationHeaderValue("Bearer", accessToken);
return Task.CompletedTask;
}));
//Line which is throwing the error
var site = await graphClient.Sites.GetByPath("/sites/slsqa/eeps", "https://cdkgroup.sharepoint.com").Request().GetAsync();
Подробнее здесь: https://stackoverflow.com/questions/796 ... t-error-me