Office 365 Scope - AppID and Certificate Authentication: not working unattended

Dear UiPath team,

I am using an O365 scope with appID and certificate authentication to make a mail message unread.
This is working when i log in to the VPS of my company, but as soon as i try to run it unattended (without me logging in to the vps) it gives me an exception:

Code: generalException
Message: An error occurred sending the request.

at Microsoft.Graph.SimpleHttpProvider.SendRequestAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
at Microsoft.Graph.SimpleHttpProvider.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
at Microsoft.Graph.BaseRequest.SendRequestAsync(Object serializableObject, CancellationToken cancellationToken, HttpCompletionOption completionOption)
at Microsoft.Graph.BaseRequest.SendAsync[T](Object serializableObject, CancellationToken cancellationToken, HttpCompletionOption completionOption)
at Microsoft.Graph.MessageRequest.UpdateAsync(Message messageToUpdate, CancellationToken cancellationToken)
at UiPath.MicrosoftOffice365.Services.GraphServiceClientProxy.MarkAsReadUnreadAsync(MarkAsReadUnreadRequest request, CancellationToken cancellationToken)
at UiPath.MicrosoftOffice365.Activities.Mail.MarkAsReadUnreadConnections.ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken)
at UiPath.Shared.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Greetings,
uiStijn

@uiStijn

Did you provide the account details in the get mails activity?

Cheers

Hi @uiStijn

Would you please ensure that the account used for appID and certificate authentication has the necessary permissions to access and modify the mail messages. Double-check the permissions assigned to the app registration in Azure Active Directory, and verify that it has the required permissions for reading and modifying mail.

Thanks!!