We have an OnPremise Environment for SharePoint 2013. where we have created SharePoint hosted app which calls "http://<appweburl>/_api/SP.UserProfiles.PeopleManager/GetMyProperties
" to get current user's data but this gives me 401 unauthorized error.
Notes:
- I had given read permission to user profile and full control to sitecollection in appmanifest. If I run this app on Office 365 developer site it works fine, but on premise environment it give 401 error.
- On premise environment when I deploy this app 3 times it prompt for credential and finally gives the following error
Message from webpage
{"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied. You do not have permission to perform this action or access this resource."}}}
Any help will be appreciated.