I need to use the SharePoint Rest API from a custom JavaScript application (outside from SharePoint).
How can I authenticate the user to use the Rest API.
I can not deploy a SharePoint app, I need those web services from my app.
I need to access to SharePoint on premise data.

  • I'm not convinced you can't use something like provider-hosted app. However if you want to hack around you could use a proxy. – eirikb Mar 6 '15 at 8:29
  • So is there no way to call API from outside SharePoint? – Nk SP Mar 6 '15 at 8:30
  • None of the APIs will let you do CORS AFAIK, which makes me think of using a proxy. Why can't you just use the token you get from TokenHelper in a provider-hosted app and then just route all REST requests through your provider-hosted app? I would imagine you could just pass requests – eirikb Mar 6 '15 at 8:37
  • This discussion would help you Update items using REST API from outside – Kushan L Perera Jun 14 '16 at 6:28

It appears that such a scenario is now possible: https://msdn.microsoft.com/en-us/office/office365/howto/create-web-apps-using-CORS-to-access-files-in-Office-365

How to authenticate external app

Disclaimer: I have not tested this scenario yet..

  • This is quite nice. Does it only work with Azure AD? What about "plain" 365, and on-premise? – eirikb Mar 10 '15 at 6:13
  • You will need Azure AD or ADFS (on-premise AD) to create OAuth tickets for authentication.. without this, it will not know how to issue tickets and coordinate authentication among different parties.. – Shailen Sukul Mar 11 '15 at 7:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.