Brief of what I am trying to achieve: Would like to create root folder properties for a list thats in SharePoint online host web from a remote web service hosted in azure web app.
Have the hybrid set-up as below:
- SharePoint Hosted Add-in
- Azure Web app - Provider hosted add-in which has wcf service.
- Registered my remote add-in using http:///_layouts/15/AppRegNew.aspx form.
- Have the client ID & client secret by registering add-in.
- updated the add-in manifest xml with the above client id & add-in web config with above client id & client secret.
From the SharePoint hosted add-in page on button click, I am able to call the published remote wcf service end point with parameters (hostWebUrl, listId, propKey, propValue).
Created a client context = new clientcontext(hostWebUrl), how ever I get 403 forbidden error at this point.
All the web sources suggest to get contexttoken, but since this is a wcf service there is no HTTPRequest instead have the requestcontext.
How do I get the contexttoken and authenticate the host web using oAuth?
Any help with this & a working example would be highly appreciated.
Many Thanks, Shan