SharePoint Online - Rest api auth

Copper Contributor

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 

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:

https://github.com/OfficeDev/TrainingContent/tree/master/O3656/O3656-3%20Deep%20dive%20into%20ShareP...