I am trying to use SharePoint Rest API from a standalone application with hard-coded user id and password. The operations are working fine using this method. But we are trying to authenticate the current logged in user and send some header with the Rest Call so the SharePoint will do the authentication and authorization by itself with respect to the current user.
I went through this article and found out that we can send
Authorization: Bearer <access_token>
to authenticate the current user. But it is also mentioned in the article that the solution is specific to SharePoint Online only and not to the SharePoint On-Premise (SharePoint 2013 in my case).
So my question is how can I can do the same in SharePoint 2013.
- I can only use Rest API and not CSOM or JSOM
- I cannot create any provider hosted app (if it is a way)
- If I open any SharePoint page in an I-Frame in my stand alone application page, is there way to grab some cookies or token from there and then pass them in my Rest Calls to SharePoint to authenticate the current user.
Thanks in advance..