Authentication
The first step to understanding who is using your API is being able to identify consumers. The role of authentication is to establish a valid identity for all the users of your API. Each API consumer becomes an identified entity that you can track individually. With authentication, every request to your API can be mapped to a single consumer. Let’s see how you can set up your API to enable authentication. First, let’s look at how you can authenticate users:
- HTTP basic authentication: On each request, the consumer sends a username and password to the server. The data is encoded using the Base64 method, and unless you’re using a secure HTTP server, this method is not considered secure because the information can be intercepted.
- API key: Consumers send a key along with the other information on each request. The API key can be sent on an HTTP header, the query string, or a specific field. API keys can have any format and are typically an...