I'm trying to install our app using the PowerShell and after running the application I get an error while accessing the user profile data. We are using the following permissions in our app:
AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="Read" AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl"
This is the part of the PowerShell where I set up the permissions:
Register-SPAppPrincipal -DisplayName $appName -NameIdentifier $appIdentifier -Site $web $principal = Get-SPAppPrincipal -Site $siteCollection -NameIdentifier $appIdentifier Set-SPAppPrincipalPermission -Site $siteCollection -AppPrincipal $principal -Scope SiteSubscription -Right FullControl
If the app is installed from SharePoint it works perfectly, therefore I think the problem lays in the app permissions.