## API Security ### Authentication vs Authorization --- ## Terminology
Authentication (tokens)
The process of verifying who a user is.
Authorization (access tokens, keys)
The process of verifying what an application has access to.
--- ### Real-world example When you go through security in an airport: 1. You show your ID to
Authenticate
your identity. 2. Then, when you arrive at the gate, you present your boarding pass to the flight attendant, so they can
Authorize
you to board your flight. Source:
Authentication vs. Authorization
on Auth0 --- ### API Keys - Is an **Authorization** scheme that does _not_ **Authenticate** the user. - Identify the application making the request and can be revoked. - Are considered public and are inherently insecure because they are often shown in the URL as a Query Parameter (and therefore can't be encrypted).
example.com/api/invoices?
token=sdafnDuTD83
--- ### The general process for creating a key 1. Login to the service portal. 2. Find/generate your API key. This is usually under Settings or similar. 3. Copy your API key into your application. 4. Follow the instructions provided by the service to test your API key. --- ## Extra Reading -
Authentication vs. Authorization
(Auth0) -
Why and when to use API keys
(Google Cloud) -
API Keys vs OAuth Tokens vs JSON Web Tokens
(Zapier)