Hi @NPE ,
According to my research and testing, you can use App Only Authentication, first you need to register the app in the SharePoint, grant proper permission, and then use the following code via CSOM:
string siteUrl = "https://contoso.sharepoint.com/sites/demo";
using (var cc = new AuthenticationManager().GetACSAppOnlyContext(siteUrl, "[Your Client ID]", "[Your Client Secret]"))
{
cc.Load(cc.Web, p => p.Title);
cc.ExecuteQuery();
Console.WriteLine(cc.Web.Title);
};
You can follow the steps in this document: Granting access using SharePoint App-Only
Also, our forum mainly discuss about SharePoint development using C#, as your issue is about development using C++, we suggest you can create a new thread on techcommunity for help:
techcommunity :
https://techcommunity.microsoft.com/t5/sharepoint-developer/bd-p/SharePointDev
Hope it can help you. Thanks for your understanding.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.