Salesforce interview question

Explain how APIs can be secured with oauth2