Hello I need to create program that will load data from Outlook calendar, which is done using Microsoft Graph API, so i have this code:
var scopes = new[] { "https://graph.microsoft.com/.default" };// Multi-tenant apps can use "common",// single-tenant apps must use the tenant ID from the Azure portalvar tenantId = "teanantid";// Values from app registrationvar clientId = "clientid";var clientSecret = "clientsecret";// using Azure.Identity;var options = new TokenCredentialOptions{ AuthorityHost = AzureAuthorityHosts.AzurePublicCloud};// https://learn.microsoft.com/dotnet/api/azure.identity.clientsecretcredentialvar clientSecretCredential = new ClientSecretCredential( tenantId, clientId, clientSecret, options);var graphClient = new GraphServiceClient(clientSecretCredential, scopes);var x = await graphClient.Users["clientid"].Request().GetAsync();
var scopes = new[] { "https://graph.microsoft.com/.default" };// Multi-tenant apps can use "common",// single-tenant apps must use the tenant ID from the Azure portalvar tenantId = "teanantid";// Values from app registrationvar clientId = "clientid";var clientSecret = "clientsecret";// using Azure.Identity;var options = new TokenCredentialOptions{ AuthorityHost = AzureAuthorityHosts.AzurePublicCloud};// https://learn.microsoft.com/dotnet/api/azure.identity.clientsecretcredentialvar clientSecretCredential = new ClientSecretCredential( tenantId, clientId, clientSecret, options);var graphClient = new GraphServiceClient(clientSecretCredential, scopes);var x = await graphClient.Users["clientid"].Request().GetAsync();