'Graph client access
im trying to get access to graph account in windows service app. this is my code.
IConfidentialClientApplication clientApplication = ConfidentialClientApplicationBuilder
.Create(ObjectId)
.WithClientId(clientId)
.WithTenantId(TenantID)
.WithClientName(UserName)
.WithClientSecret(SecretValue)
.Build();
var authProvider = new ClientCredentialProvider(clientApplication);
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
IUserRequestBuilder client = graphClient.Users[clientId];
var messages = await client.MailFolders["Inbox"].Messages
.Request()
.Expand("attachments")
.GetAsync();
foreach (var mssg in messages)
{//do my things}
in the "await client.MailFolders["Inbox"].Messages" line i get Status Code: NotFound Microsoft.Graph.ServiceException: Code: ResourceNotFound Message: User not found
thanks for any answer
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
