SharePoint: Enabling App Authentication on Azure Tenant
To enable app only authentication for applications created on Azure Entra you need to enable interactions with sharepoint REST/Graph APIs.
Below steps should be follows from Powershell in your PC:
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
$adminUPN = "your-admin@yourdomain.onmicrosoft.com"
$orgName = "yourdomain"
$userCredential = Get-Credential -UserName $adminUPN -Message "Enter your password"
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential
Set-SPOTenant -DisableCustomAppAuthentication $false
This should be the last step after creating an Azure Entra Application and giving it application permissions necessary for SharePoint.
For the client ID and Client Secret to create a valid(usage) token - bearer token- used to authorize access to REST/Graph APIs.