Forum Discussion

aggagnon's avatar
aggagnon
Copper Contributor
Feb 17, 2023

Can't access PWA through REST Api

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.

 

 

 

 

No RepliesBe the first to reply

Share

Resources