Share via

REST API access to SharePoint pwa/_api/ProjectData/ returns <User could not be authenticated because logon permission has not been granted>

Anonymous
2021-06-10T14:31:21+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"
  2. Use the following site to create AppId: https://{server}.sharepoint.com/sites/pwa/_layouts/15/appregnew.aspx
  3. Register the application and define the scope using the following url: https://{server}.sharepoint.com/sites/pwa/_layouts/15/appinv.aspx
  4. 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"
  5. I tried scopes: Scope="http://sharepoint/projectserver/project" Right="Read", same issue as above
  6. Finally, I applied: <AppPermissionRequests><AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl"/></AppPermissionRequests> and the App was registered
  7. 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)
  8. I assume whatever permission is preventing me to register the projectserver scope is what is causing me the error. However, I have added myself to all the Permission groups, but still not able to add the projectserver scope.
  9. Are you able to highlight some steps, and possible issues I might be able to take to our sharepoint team to resolve?
Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2021-06-10T18:58:19+00:00

Dear Karun,

We are sorry for the inconvenience happened at your end.

Our forum focus on the OOB issue related to SharePoint Online and Microsoft 365, we suggest you post this query in Microsoft Q&A Forum since it’s related to server and REST API.

The experts will provide efficient and dedicated suggestions for you. Please don’t mind we redirect you to another forum, it’s the better way for resolving this case. Your understanding is highly appreciated.

Best Regards,

Ivy

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful