But still I get the below error. Do you have any clue why??
Microsoft.Graph.ServiceException: Code: generalException
Message: An error occurred sending the request.
—> Microsoft.Identity.Client.MsalServiceException: AADSTS1002012: The provided value for scope Mail.ReadWrite Mail.Send User.Read is not valid. Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI). Trace ID: Correlation ID: Timestamp: 2024-01-15 09:40:26Z at Microsoft.Identity.Client.Internal.Requests.RequestBase.HandleTokenRefreshErrorAsync(MsalServiceException e, MsalAccessTokenCacheItem cachedAccessTokenItem)
at Microsoft.Identity.Client.Internal.Requests.ClientCredentialRequest.ExecuteAsync(CancellationToken cancellationToken)
at Microsoft.Identity.Client.Internal.Requests.RequestBase.RunAsync(CancellationToken cancellationToken)
at Microsoft.Identity.Client.ApiConfig.Executors.ConfidentialClientExecutor.ExecuteAsync(AcquireTokenCommonParameters commonParameters, AcquireTokenForClientParameters clientParameters, CancellationToken cancellationToken)
at UiPath.Shared.Authentication.Microsoft.Services.MsalLogonService.AuthenticateInternalAsync(OAuthDataOptions oauth, CancellationToken cancellationToken)
When I mentioned specifying scopes for operations like Mail.ReadWrite, Mail.Send, and User.Read, I was referring to the permissions that need to be assigned to your Azure AD application in order to access Microsoft Graph API.
I have exactly the same problem and tried to update the application id and scope in Azure > Expose API, but it does not allow me to put a dot before “default” for the scope so mine is in the following format api://application ID/default. If I change the application name to have /.default then when I update the scope I have api://application ID/.default/default. Any ideas? Many thanks
I have opened a ticket to UiPath Support. We do no need to add /default. It was a bug in the new package for MicrosoftOffice365. As per their reply, “The unaffected version is 2.3.3.”
Please try it and keep me updated.
Good luck!