On old created Office 365 tenants I use to authenticate to SharePoint online inside our C# console application using this code:
static void Main(string[] args)
{
string siteUrl = "https://***.sharepoint.com/sites/CustomerServiceKB/";
string clientId = "******";
string clientSecret = "*****";
using (ClientContext context = new OfficeDevPnP.Core.AuthenticationManager().GetAppOnlyAuthenticatedContext(siteUrl, clientId, clientSecret))
{
...
}
}
But, as per my knowledge newly created Office 365 tenants has SharePoint app-only permissions disabled.
So will my above code fail to work if the SharePoint app-only permissions is disabled inside our newly created tenant?
Edit
now based on the reply i got from @Asad >> he linked me to this blog >> https://sharepointstew.wordpress.com/2021/07/07/app-only-authentication-in-sharepoint-online-using-latest-azure-sdk/ >> but this blog is using PnP.Framework.AuthenticationManager
which is based on this link @ https://www.nuget.org/packages/SharePointPnPCoreOnline is deprecated as well... so how i can authenticate my .net core console application to SharePoint using non-deprecated approach? i feel that i will never get an answer ..
DisableCustomAppAuthentication
is set to Yes... i know that i can set it to false but i do not want to modify our tenant settings as we need to keep the setting most secured..