I have an exact situation with this question: What are some viable techniques for combining csrf protection with RESTful APIs?
One answer given talks about using
- basic authentication with SSL
- 1 API key per application
- OAuth
I am already convinced about implementing OAuth2.0 where you will have access_token, client_id, client_secret for each app.
However, I was not aware that this would actually help prevent CSRF.
My opinion is that at the end of the day, you still need ssl.
Because in OAuth2.0, when the client app sends requests on behalf of the Resource Owner, they need to send alongside the data parameters such as client_id, client_secret and access token.
Without HTTPS, if the client_id, client_secret and access token are known either through leaks or man-in-the-middle, then there is still a chance of CSRF, albeit a small one because of the expiry period of the access token.
Is my understanding correct?