Sharepoint PWA API: "User could not be authenticated because logon permission has not been granted"

Karun Krishna 1 Reputation point
2021-06-10T19:54:56.107+00:00
  • Our server has Single-Sign-On, when I manually login, and go to below URL (in chrome) I am to get Projects XML OData Feed https://{server}.sharepoint.com/sites/pwa/_api/ProjectServer/Projects
  • I need to take this data and manually save the file to run my python scripts. This becomes a nightmare as I need to download all the relational data (resources, assignment, etc. ) to get the full scope of things
  • I would like to do this via python GET requests. I have done the below steps, but now stuck with the following error and do not know how to overcome it: HTTP RESPONSE: 403
    {'odata.error': {'code': '-2147024891, Microsoft.Office.Project.Server.Exceptions.ProjectServerUnauthorizedAccessException', 'message': {'lang': 'en-US', 'value': 'User could not be authenticated because logon permission has not been granted'}}}

Steps I've taken to get REST API Access:

  1. PWA is set to "Project Permission Mode"
    Use the following site to create AppId: https://{server}.sharepoint.com/sites/pwa/_layouts/15/appregnew.aspx
  2. Register the application and define the scope using the following url: https://{server}.sharepoint.com/sites/pwa/_layouts/15/appinv.aspx
    The Request XML I used is the following: <AppPermissionRequests AllowAppOnlyPolicy="true"><AppPermissionRequest Scope="http://sharepoint/projectserver" Right="Manage" /></AppPermissionRequests> however, when I press CREATE, I am presented with the following landing page: "Sorry, you don't have access"
  3. I tried scopes: Scope="http://sharepoint/projectserver/project" Right="Read", same issue as above
  4. Finally, I applied: <AppPermissionRequests> <AppPermissionRequest Scope="http://sharepoint/projectserver" Right="Manage"/><AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="Manage"/></AppPermissionRequests> and the App was registered (Note, I did not use AllowAppOnly=True)
  5. However when it came time to accessing the URL for the project. I am presented with the HTML response I outline above. (Please note that I am getting the Bearer Token successfully, as I am able to hit the following url and get the web list: https://{server}.sharepoint.com/sites/pwa/_api/web Response: 200)
  6. Is there something I need to send in the GET header that specifies my Username? (Since I am using Bearer Token, not sure why this would be needed)
  7. Is there something on the sharepoint admin pages that I need to enable for my User? (I have Sharepoint Admin/Owner privileges)
Community Center Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MichaelHan-MSFT 18,126 Reputation points
    2021-06-11T07:23:44.393+00:00

    Hi @Karun Krishna ,

    Project related issues are not supported here, I would suggest you ask in the Project community: https://techcommunity.microsoft.com/t5/project/bd-p/Project

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.