I have a page hosted in _layouts in SharePoint 2013. I want to make REST call to SharePoint REST api from this page using current user credentials. I don't want to do it from client-side (jquery etc)
So basically I want to make Web Request to the SharePoint REST api on the same server and pass current user authentication. I was able to do that in SharePoint 2010 by using default network credentials, but in 2013 it returns 401 Unauthorized.
Same thing with ClientContext. I cannot just do "new ClientContext(SPContext.Current.Web.Url)
"
Note: yes, there are Server APIs, but for things like Excel Services using REST API was just easier.
As I understand you need to pass access token for OAuth, but how do I get it for current user in SharePoint? Without making him reenter login/password and without using SharePoint Apps.