Hi @Wael ElKadi,
You can disable the Access permission to remote interfaces to the anonymous users, please follow the steps
- Navigate to the site (or sub-site) where you wish to enable anonymous access.
- Go to Settings - Site settings.
- Under Users and Permissions, click on Site Permissions.
- Under the Permissions tab, click on Anonymous Access.
- Choose whether you want Anonymous users to have access to the entire Web site or to lists and libraries only. Uncheck Require Use Remote Interfaces permission then click on OK.
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.