Hi @KrolyiZoltn-0660 ,
Currently, Azure AD App Client Secret authentication option is blocked by SharePoint Online, so it's not available to use Client Secret, it's necessary to use Certificate instead:
Please check the official documetation for detailed information:
Granting access via Azure AD App-Only
And here is a demo to get acess token with Azure AD App Certificate in CSOM, I suggest that you can refer :
Calling SharePoint Online APIs using Azure AD App-Only permissions and certificate auth
If an Answer 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.