Code - generalException while reading email using Microsoft 365 Activity

Hi,
I’m using Microsoft Office 365 Scope and the Get Mail activity inside to get a list of all messages in my email account.
This used to work well If I use authentication as Interactive, but If I used Application ID & secret as authentication then it gives me below error

RemoteException wrapping Microsoft.Graph.ServiceException: Code: generalException

Message: An error occurred sending the request.

—> RemoteException wrapping Microsoft.Identity.Client.MsalServiceException: AADSTS900023: Specified tenant identifier ‘64e17fe1-b7c6-4ef5-8750-45f24b52-6c44-4aae-8bce-0fb2882d5dfcf4e85cf625fa’ is neither a valid DNS name,

nor a valid external domain.

The Microsoft Office365 Scope properties used are (properties not provided are null):

ApplicationSecret:

SecureApplicationSecret:

Application Id:

Authentication: ApplicationID&Secret

Environment: Default

Services: Mail

Tenant:

OAuthApplication: UiPath

And the properties for the Get Mail activity are:

Account:

Mail Folder: “Inbox”

Results: EmailList (an Office365Message object)

Since I’m using ApplicationID&secret as Authentication types, I have added API permission for Group.Read.All , Group.readwrite.all & etc…

The version of the UiPath.MicrosoftOffice365.Activities package is v1.11.1
The studio version is 2021.4.4 and we’re testing in both attended and unattended robots with the same results.

From the looks if it, it’s a rights issue - please check docs below:

1 Like