none
How to authorize an app? RRS feed

  • Question

  • I'm trying to access our Project Online data through the REST interface, from an external server. I created an app in Sharepoint through the http://<tenantname>.sharepoint.com/sites/pwa/_layouts/15/appregnew.aspx page (sidenote: are these app creation pages documented anywhere? I found them on random blog pages but couldn't find them in MS documentation), and added the scopes I found at https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/add-in-permissions-in-sharepoint, specifically http://sharepoint/projectserver/projects = "Read" and http//sharepoint/projectserver/projects/project="Read".  I successfully obtained a client id and secret.

    I was then able to use the client id and secret to obtain an OAuth2 Bearer token through https://accounts.accesscontrol.windows.net/<my-realm>/tokens/OAuth/2.

    However, when I try to use that to access the REST resources I'm told I have no permissions to access the resource. For example, GET https://<tenantname.sharepoint.com/sites/pwa/_api/ProjectData/Projects fails saying I have no permission to access that resource.

    When I check the url /<tenantname>/sites/pwa/_layouts/15/AppPrincipals.aspx I can see my application listed.

    Any pointers are greatly appreciated.


    Tuesday, May 7, 2019 6:12 PM

All replies