What I have done to set up Project Web App for rest calls is:
- Set up a tenant in Azure:
- Visit https://portal.azure.com/ and navigate to App Registrations
- Create a new registration and name it, set the supported account types and redirect URI accordingly, I am using single tenant and localhost:3000/redirect.html as an example. Keep note of the Application (client) Id.
- Navigate to “Certificates and Secrets” under “Manage” and create a new client secret. Make sure to keep note of the value that is generated.
- Navigate to “API Permissions” under “Manage” and Add Permissions for Project.Read, Project.Write, and ProjectWebApp.FullControl, under Sharepoint -> Delegated Permissions
- Make sure that project permissions are set correctly (you will have to be a site admin to do this)
- Go to your project web app settings by clicking on the gear in the top right corner of your Project Web App and clicking on "PWA Settings"
- Under the Operational Policies heading, click Additional Server Settings
- In the Permission Management section ensure that you have Project Permission mode selected
- Get an authentication code:
- Visit:
- where resource is your Sharepoint domain, is your client Id from your Azure app registration, and redirect_uri is also from your Azure app registration.
- After you grant access to the add in, it will redirect you to your redirect uri with a code value in the URL parameters. Hold on to this value for later.
- Make the http request to get an access token:
- URL:
https://login.microsoftonline.com/common/oauth2/token
- Headers:
Accept: */*
Content-Type: application/x-www-form-urlencoded
- Body (www-form-urlencoded):
grant_type: "authorization_code"authorization_code
code: "<code<code from previous call>
redirect_uri: <redirect uri from registration>
client_id: <client id from registration>
client_secret: <client secret from registration>
Make sure all values are properly formatted in this call. These are just the values that you need to include
Use the Access token in your rest calls!
There are a couple of ways that I have read about doing this however this is the only way I can consistently get to work