API security protects APIs from unauthorized access and misuse, while API management manages APIs across their entire operation with a gateway, management plane, developer portal, and analytics. The two overlap at the gateway, which enforces policies such as authentication and rate limiting. According to NIST SP 800-228, however, every individual service must check for itself whether a caller may read exactly this object.
Authentication answers the question of who is making a request, while authorization decides what that caller may do. According to NIST, every API communication carries at least two identities: the calling software and the person who operates it. When software calls other software, a service account, which is a technical user account, takes on the second role. The endpoints and access types of APIs determine who can be a caller at all.
API keys
With every request, the calling software sends its API key along, a string that identifies it. According to OWASP, API keys should authenticate only clients and not serve to log in people.
For access tokens, NIST and the Internet Engineering Task Force (IETF) recommend the HTTP header over the URL. Browsers and web servers store addresses in history and logs without protecting them sufficiently. An API key that travels with every call is exposed to the same paths.
OAuth 2.0 and access tokens
OAuth 2.0 is an IETF authorization framework that gives a client limited access to a protected resource through an access token. The token represents the duration and extent of the access, with the extent defined by scopes.
A bearer token can be used by anyone who holds it, even without proof of a key. The IETF therefore requires protecting such tokens in storage and transport. The recommendation RFC 9700 on OAuth 2.0 security from January 2025 limits the rights of a token to what is necessary and binds it to specific recipients.
Mutual TLS (mTLS)
TLS (Transport Layer Security) encrypts the connection between two systems. With mutual TLS, the client also identifies itself with an X.509 certificate, a digital proof of identity. RFC 8705 on mutual TLS for OAuth 2.0 describes how OAuth clients authenticate this way.
At the same time, the specification binds access tokens to the certificate of the client. The protected resource then checks whether a presented token was issued to exactly this client. An intercepted token is worthless without the matching private key.
Authorization per object and field
Authorization decides anew on every access whether the logged-in caller may perform this action on the requested record. NIST requires two levels: first it is checked whether the calling service may use the API, then whether the person has access to the resource. Fields often need their own checks.
For example, a supplier retrieves its order with ID 4711 through a partner API. If its software changes the ID to 4712 and the API checks only the login, it returns another supplier’s order. OWASP therefore recommends random, unpredictable IDs and tests that stop changes with broken authorization before rollout.
