Hi @Lakshman Bana ,
PnP.Framework Library supported to use App Id and App Secret to get the ClientContext and this library supported both .NET Framework and .NET Standard:
Please first install PnP.Core as this is the dependent package for PnP.Framework:
Install-Package PnP.Core -Version 1.1.0
Install-Package PnP.Framework -Version 1.4.0
Then authentication with App Id and AppSecret ( register in https://siteurl/_layouts/15/AppRegNew.aspx) like this:
using Microsoft.SharePoint.Client;
using PnP.Framework;
ClientContext ctx = new AuthenticationManager().GetACSAppOnlyContext("SiteUrl", "AppId", "AppSecret");
ctx.Load(ctx.Web);
ctx.ExecuteQuery();
Here is a detailed blog for your reference:
Thanks
Best Regards
If the response is helpful, please click "Accept Answer" and upvote it.
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.