We would like to retrieve user's information from Azure Active directory using Microsoft Graph SDK.
Given a valid email address, but I get an error
Resource '[email protected]' does not exist or one of its queried reference-property objects are not present.
Code is below. Can you please guide?
IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder.Create(clientId).WithTenantId(tenantID).WithClientSecret(clientSecret).Build();
ClientCredentialProvider authProvider = new ClientCredentialProvider(confidentialClientApplication);
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
var user = await graphClient.Users["[email protected]"].Request().GetAsync();