C#:
PeopleManager peopleManager = new PeopleManager(clientContext);
PersonProperties personProperties = peopleManager.GetMyProperties();
try
{
clientContext.Load(personProperties, p => p.AccountName, p => p.UserProfileProperties);
clientContext.ExecuteQuery();
}
catch (Exception ex)
{
Console.Write("error occur while retrieve person properties ", ex.Message.ToString());
}
AppManifest.xml
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
<AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" />
</AppPermissionRequests>
After providing tenant permission it still showing - You do not have permission to perform this action or access this resource.
Thanks for the help!
<AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="Read" />