Forum Discussion
Gary Minnock
Jan 25, 2018Copper Contributor
SharePoint Online - Rest api auth
Hi,
I need to make rest requests to SharePoint from a simple command line utility (C#).
I've used CSOM/Caml with OfficeDevPnP previously but now need to perform rest calls to lists.
I used this code to authenticate:
AuthenticationManager authMgr = new AuthenticationManager();
ctx = authMgr.GetSharePointOnlineAuthenticatedContextTenant(spsite, spusername, sppassword);
How do I authenticate for rest calls over HttpClient?
Tks
- Check out this module in the OfficeDev/TrainingContent repo... slides, demo & hands on lab complete with the built solution for calling the SP REST API:
https://github.com/OfficeDev/TrainingContent/tree/master/O3656/O3656-3%20Deep%20dive%20into%20SharePoint%20Lists%20with%20REST%20APIs