Microsoft 365 Scope 'Get Mail' giving NoPermissionInAccessToken error

I am trying to use OAuth for my application and using Microsoft 365 Scope with authentication type ‘ApplicationIdAndSecret’. I have registered Microsoft Graph Api on Azure and have granted Mail.Read permissions, but while executing I am getting following error. Can someone please help me on this? I am new to using Microsoft Graph Api.

Hi,

I received this error as well while using ApplicationIdAndSecret authentication type. This was because the permission type in the app registration was set to Delegated. For ApplicationIdAndSecret authentication type, the permission type needs to be Application.

Reference: https://docs.uipath.com/activities/docs/office365-setup