Trouble with OAuth Bearer Token to get list of folders.

Copper Contributor

We're trying to utilize Azure Data Factory to read an Excel file on SharePoint. 

We've registered the app in AD, we've trusted the app in SharePoint. 

I can make a web call to: https://accounts.accesscontrol.windows.net/[Our_TenantID]/tokens/OAuth/2

and I receive a valid token. 

When I try to pass that token to https://[Tenant_NAME].sharepoint.com/sites/[TeamSite]/_api/web/GetFolderByServerRelativeUrl('/Shared...

I get this response: {"odata.error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"}}}

 

I don't know if I don't have the right Relative URL, or if I don't have the App Registration / Trust set up correct. 

Does anyone have experience with this? 

Thanks, in advance, 

 

-Brian

0 Replies