I am creating a RESTFul API and wondering what is the best way to do auth? Users need to authenticate. I know three ways:
1.) Pass the API API in each RESTFul request:
http:
This is good because developers can immediately start using the API by simply copying the URL string into the browser. Are there any potential security risks?
2.) Each request passes the API key to the request header.
This seems more secure, but developers cannot make requests through their browser. CURL required.
3.) oAuth
I have to admit that I know little about this, but it seems very popular. My concern is that using the API has become its barrier to developers. First, they should be familiar with oAuth and configure it.
Thoughts? Thank you very much.
source share