REST API를 사용하여 SharePoint 목록에 액세스 가능한 크로스 도메인을 만드는 것이 가능합니까?

sharepoint.stackexchange https://sharepoint.stackexchange.com//questions/96997

  •  10-12-2019
  •  | 
  •  

문제

REST API를 사용하여 인터넷을 통해 SharePoint 2013 리소스를 액세스 할 수 있습니까?SharePoint 외부에서 목록으로 두부를 원합니다.이 상황에 대한 자격 증명을 어떻게 관리 할 수 있습니까?나는 일부 사이트 (Yammer)가 회사 웹 사이트로 사용자를 리디렉션하고 거기에서 자격 증명을 얻음으로써 SSO를 사용했습니다.자격 증명을 위해 REST API와 동일한 접근 방식을 사용할 수 있습니까?그렇다면 어떻게 설명 하시겠습니까?(자격 증명 부분 만)

도움이 되었습니까?

해결책

Assuming you have SharePoint on-premise and not 365.

Making a client-side only solution is easy if you use apps (SharePoint hosted), but you would have to deploy the app to SharePoint to be able to do cross-domain request.
Microsoft introduced two main solutions for querying cross-domain, SP.RequestExecutor.js for JSOM and /_api/SP.AppContextSite for REST, but as far as I know both of these require that you have an app hosted in a SharePoint environment. Here you don't need to think about authentication, as long as the app deploys that is handled for you.
If you have a stand-alone web site and you want client-side only communication with SharePoint I'm afraid that OOTB this is not possible. I can think of some solutions, as you can enable cross-domain, get access token for OAuth (might be 365 only) server-side or make your own service on SharePoint which supports CORS or JSONP - but this would be far from OOTB.

If you instead do the communication server-side everything will be much easier. I suggest you try making a Provider-hosted app, you will find this option in Visual Studio when creating apps for SharePoint. Then you set up High trust (S2S) which will let your app use CSOM to communiate with your on-premise SharePoint, authenticated as a user.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top