Forum Discussion
Auth0 authentication with SharePoint REST api
- Feb 26, 2019
As it happens, Paolo Pialorsi just did a demo on a potentially similar situation to yours!
https://www.youtube.com/watch?v=cRuSk21N810
Hi Joseph,
Here's a pretty comprehensive list of the tools available for authenticating from a Node app to SharePoint Online.
https://github.com/SharePoint-NodeJS/Awesome-SharePoint-Node.js
What's your situation though? Do you need user permissions? For example, are you making calls to SharePoint lists where you need to return only items to which the logged in user has permissions? If that's the case, you're going to want to use the user's credentials and possibly look at Microsoft Graph with delegated permissions rather than direct connections to SharePoint.
https://docs.microsoft.com/en-us/graph/auth-overview
https://docs.microsoft.com/en-gb/graph/tutorials/node?tutorial-step=3
If you just need your app to connect to SharePoint and you don't need to security trim results or access by user (all users have the same permissions to your SharePoint list/library), your easiest option is probably to register the app in SharePoint or Azure AD grant it "App-Only" permissions for SharePoint then use the clientID and clientSecret from that. The first link has some resources for doing that from a Node app.
- Thomas BermanFeb 26, 2019Iron Contributor
As it happens, Paolo Pialorsi just did a demo on a potentially similar situation to yours!
https://www.youtube.com/watch?v=cRuSk21N810