SharePoint Online - Rest api auth

Copper Contributor


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?


1 Reply
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: