Hi @Amir tounsi,
Thank you for posting in this community.
Based on the description of your problem, it seems that everything is fine with your configuration.
We can check our operation again:
1.Are you trying to grant access using SharePoint App-Only? If so, please refer to this article to make sure your configuration is OK.
2.Please double check that your siteUrl, clientId, clientSecret are correct.
3.Please double check that your Application Permission.
4.Try another site.
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.