'Need to restrict user to access SharePoint APIs from the code using UserId and Password

Is it possible to restrict any developer/person to call SharePoint API from backend (any code) using his/her userid and password? But he/she can call the same APIs by using the ClientId and Secrets.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source