So I am trying to show a table that displays data from another server (via jQuery-Ajax for example). Now I have to secure the server that serves this data from unauthorized access. My idea would be that only users that have access to a specific SharePoint-site can access the REST-Api on the other server. So the process I intend to achieve is the following:
- User goes on Sharepoint site ( let's call it
www.corp-sharepoint.com/reporting) - The webpage returns content. In this content there is for example a script editor, that should then load the data from my other server ( let's say
www.reportingdetails.com/details) - The browser makes an ajax-Request to
www.reportingdetails.com/detailsand passes information about the current user - The server at
www.reportingdetails.com/detailsgets the request, it then connects to SharePoint and asks whether the user logged in, whose information was passed by the browser, has access to pagewww.corp-sharepoint.com/reporting. If he has, the servers full fills the request and sends back the data, otherwise it sends a401error.
What would be a possible approach to establish this connection between SharePoint and my server mentioned in step 4?