2 ms·
You have multiple options. If you use SSL, then it might be easiest to just use http authentication, transmitting the users credentials for each request, which
by pilif 16y ago
You have multiple options.
If you use SSL, then it might be easiest to just use http authentication, transmitting the users credentials for each request, which is also the only official restful solution (each request should be independent of each other request).
If you don't want to do that, create an endpoint that takes username and password and returns a token which must then be present in each request (maybe even as part of the authorization header).
Or use OAuth.
- jsarch 16y agoAnother option is the use of API keys that are separated into two types -- partners and end-users. The partner API keys would be bound to a particular end-point (e.g., the IP address of the web server) while the end-user API key could be used from anywhere (e.g., from a mobile device).