Unable to access PWA Rest API using Client Credentials

Alexandre Girard-Gagnon 0 Reputation points
2023-02-16T17:00:08.4166667+00:00
Nov 02 2022 06:20 AM
Error when accessing Project Server through Postman using Bearer authentication

I'm trying to access our project web app using Project Server's REST API. I have already went though the configuration from Registering a new App : https://tenant.sharepoint.com/sites/pwa/_layouts/15/appregnew.aspx

 

Then, I created the authorization settings  https://tenant.sharepoint.com/sites/pwa/_layouts/15/appinv.aspx

with this XML Permission Request. 

 
<AppPermissionRequests AllowAppOnlyPolicy="true"> 
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" /> 
</AppPermissionRequests> 

 

I was easily able to retrieve the Bearer Token for the request in Postman, so I guess the above steps worked fine.

I receive an error when I try to access any of the endpoints using the given Bearer Token : {{site_url}}/_api/ProjectServer/{{some_endpoint}}
(I've also tried using ProjectData instead of ProjectServer, but no luck either)

 

When I click Send I received the following message

 

{
    "error": {
        "code": "-1, System.InvalidOperationException",
        "message": {
            "lang": "fr-FR",
            "value": "User:<customercontent></customercontent> not found in Active directory or in project db."
        }
    }
}

 
I've literally checked every thread about the subject, but I can't seem to find any workaround. Have I missed a step? It seems like the authentication is trying to find a user in AD or in the Project Database instead of using the Bearer authentication. I've tried entering this URL in a browser AFTER I authenticated with my Microsoft account, and it worked. 

Also, every time I tried to post a question on Microsoft Support, I have been redirected over and over. It's been weeks and I still haven't found a way to make this work. 
Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,573 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,596 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 34,661 Reputation points Microsoft Vendor
    2023-02-17T01:35:42.1433333+00:00

    Hi @Alexandre Girard-Gagnon

    Since your issue is about Project, our forum focus on SharePoint. I will recommend you to go Project Tech Community for some more professional advice. Here is the forum dedicated to Microsoft Project issues. If you have any issues about SharePoint in the future, please not hesitate to raise a ticket in our forum.
    https://techcommunity.microsoft.com/t5/project/ct-p/Project


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


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.