Mar 01 2017 10:19 AM
We have a requirement wherein, we will need to retreive some data from sites and lists hosted in SharePoint 2013 on-premise into an externally hosted .Net web application. The obvious thought was to the execute SharePoint REST APIs from the externally hosted .Net web application however, we got stuck with the authentication issue as it will be cross-domain.
The .Net web application is also expected to support AD authentication however, how to get it to pass the same to the REST API request?
Hence, we were thinking what are the options, one thought is to use the cross-domain library from SharePoint however, we couldn't find samples around this (most of what we find where actually related to apps/addins).
So, is cross-domain library is the only option for our scenario or are there any more options? Please suggest.
Mar 01 2017 12:30 PM
Your .Net web application will need to use the TokenHelper.cs classes to request an access token. That access token must be sent in the Authorization header.
Unless you have already configured your farm to connect with an O365 tenant, you should use the S2S methods in TokenHelper.
Mar 01 2017 06:50 PM
I believe tokenhelper will be useful in SharePoint Online scenarios however, as mentioned we are completely working on SharePoint On-premise.
So, both SharePoint and .Net web application reside on-premise however hosted separately in different envrionments in on-premise.
Mar 02 2017 05:12 AM
The S2S methods are for on-prem.
Mar 02 2017 10:34 AM
Believe you mean establishing a server to server trust?
In case there are any blogs/articles that provide additioanl details on how to setup this for an on-premise scenarios will be helpful.