← All articles

API Security Beyond Authentication

Practical API security: object authorization, token validation, resource limits and evidence that gateway and application controls work together.

A request can carry a valid access token, match an OpenAPI schema and stay below a rate limit while requesting another customer’s invoice. Its format is acceptable. Its caller may be a legitimate customer. The application still has to decide whether that customer may read that particular invoice.

API security brings these decisions together: which interfaces are reachable, which identities they accept, which operations those identities may perform and how much work each operation can consume. A Web Application and API Protection (WAAP) platform contributes shared traffic controls and security observations. The application supplies the business rules and resource relationships needed for its access decisions.

Know which APIs are actually reachable

Maintain an inventory that connects each API version with an owner, its consumers, the data it handles and its intended exposure. Include administrative interfaces, partner integrations, internal services and test environments connected to production data.

Compare that inventory with deployed gateway routes, service configuration and observed traffic. Discovery tools can help identify discrepancies, but traffic observation alone will miss endpoints that nobody called during the observation period.

Retirement needs an operational check. Removing an endpoint from documentation leaves its implementation reachable unless the deployment and routing change too. OWASP describes this class of exposure under API9:2023, Improper Inventory Management.

Establish identity and validate the credential’s purpose

OAuth 2.0 provides a framework for delegated access. OpenID Connect adds end-user authentication. An API should accept an access token intended for that API; an ID token issued to a login client serves a different purpose.

For browser and mobile clients using the authorization code flow, use PKCE with the S256 method and follow the OAuth security best current practice. Choose token lifetimes, renewal and revocation behaviour for the sensitivity of the operation.

JWT is a token format. When an API accepts signed JWT access tokens, validate the signature using trusted keys and an explicitly permitted algorithm, the expected issuer and audience, expiry and other claims required by the token profile. A valid signature does not make a token intended for another service acceptable. The JWT access token profile defines these requirements for conforming OAuth access tokens.

An API key can authenticate possession of a client credential, but it does not by itself establish which person is acting or which records they may access. Scope credentials narrowly and provide controlled storage, rotation and revocation. Machine clients also need explicit service identities and permissions.

Authorize the action, object and fields

Consider this request from an authenticated customer:

GET /api/invoices/inv_8421

A scope such as invoices:read may permit calling the endpoint. The application must also establish whether this customer may read this invoice, in this tenant, under the current policy. Changing the identifier to an unpredictable UUID does not replace that check.

This is the concern behind OWASP API1:2023, Broken Object Level Authorization. A single request for the wrong object can expose data without looking anomalous or exceeding a traffic threshold.

Authorization also applies to functions and individual properties. Permission to edit a delivery address should not imply permission to change an account’s owner, tenant or administrative role. Define allowed response fields as deliberately as writable fields. OWASP API3:2023 covers both unauthorized disclosure and unauthorized changes to object properties.

RBAC and ABAC can express these policies. Their value depends on whether the decision uses trustworthy identity, current resource relationships and the requested action.

Make the data contract enforceable

Use OpenAPI or another explicit schema to define accepted methods, media types, field types, lengths and ranges. Where supported and configured, gateway validation can reject requests outside that contract before application processing begins.

The application still needs validation appropriate to its operation. Map accepted input to explicitly writable fields, reject unexpected writable properties according to the contract, and use parameterized database queries. Avoid binding an arbitrary request body directly to a persistent model.

Validate the response as well. Serializing an entire database object can expose internal flags or personal information that the caller was never meant to receive. A schema describes the shape of permitted data; authorization determines who may receive or change it.

Limit resource use and sensitive workflows

Requests have different costs. Reading one invoice, exporting a tenant’s records and sending an SMS should not share an undifferentiated request allowance.

Apply suitable limits to verified client or user identities, tenants and operations, with IP limits providing an additional control. Bound request sizes, pagination, batch sizes, execution time, concurrency and paid downstream activity. OWASP’s API4:2023 resource-consumption guidance explicitly includes operational costs as well as service availability.

A distributed limiter needs defined counter updates, burst behaviour and a policy for unavailable state. A shared Redis instance alone does not establish those properties. Use 429 Too Many Requests for rate-limit responses and provide retry guidance where appropriate.

Some abuse stays within ordinary traffic limits. Repeated reservations, account creation or discount redemption can harm the business while each request remains technically valid. OWASP API6:2023 addresses these sensitive workflows. Their protections may require per-account eligibility, transactional constraints and concurrency checks inside the application.

Extend the trust boundary to other services

Use HTTPS from the client’s first request and validate server certificates. A redirect cannot recover credentials already sent over an unencrypted connection. Apply transport protection to upstream connections too, with mTLS where service identity and policy require it.

An internal network address is insufficient evidence of identity or authority. Validate the credential or authenticated identity context accepted at each boundary. Restrict backend reachability so a direct connection cannot bypass required gateway controls.

Outbound requests need restrictions of their own. An import URL or webhook destination can turn a service into a route to internal systems. Apply destination allowlists where practical, account for resolved addresses, disable or strictly validate redirects, and enforce network egress policy. Treat third-party responses as untrusted input. The OWASP SSRF prevention guide describes application and network controls for this boundary.

Give WAAP controls a defined role

A WAAP deployment can apply shared authentication checks, request constraints, inspection, automation controls and traffic limits where those capabilities are supported and configured. Its effectiveness depends on the routes, protocols and policy actually covered.

The application’s object relationships need an enforcement mechanism that understands them. An ordinary WAF rule cannot establish invoice ownership. Behavioural signals may identify suspicious access patterns, but authorization must also reject a prohibited request from an otherwise ordinary client.

Legitimate automation matters here. Service integrations and API clients often cannot complete browser challenges. Select responses compatible with the protected interaction and the identity assurance it requires. Application-layer traffic limits also need upstream network DDoS protection when an attack could exhaust connectivity before reaching the gateway.

Our Sovereign Fortress High Assurance WAAP project combines ML-based application inspection, behavioural and automation signals, reputation and explicit risk policy. We distinguish what a component observed, what policy decided and what the gateway enforced. Those roles are explained in Security Signals, Risk Decisions and Enforcement.

For API protection, that distinction helps define which controls are active and what evidence would demonstrate their effect. A risk signal should not grant access that the application’s authorization policy prohibits.

Test the decision and its consequences

Turn important restrictions into repeatable tests. Include expired tokens, wrong audiences, cross-tenant identifiers, forbidden fields and concurrent attempts to consume a limited entitlement.

TestRequired evidence
Read an invoice belonging to the caller’s tenantThe permitted data is returned, with the intended response fields.
Request another tenant’s invoiceThe API denies access under its contract and discloses no unauthorized invoice data.
Attempt to change a protected propertyThe prohibited change is rejected and the stored value remains unchanged.
Exceed a gateway-enforced quotaThe defined client response is accompanied by independent evidence that the blocked request was not forwarded.
Lose an authorization dependencyThe affected protected operation remains prohibited during the failure and recovery conditions specified by policy.

An edge denial and an application denial need different backend assertions. A request rejected by the gateway should not reach the protected backend. An application authorization check receives the request and must prevent the prohibited disclosure or state change. A missing backend event is inconclusive unless the observer and its observation window are known to be complete.

Preserve request correlation, the relevant principal, route, policy version, decision reason and outcome with appropriate access controls and retention. Keep passwords, raw access tokens and API keys out of logs. Metrics help identify rates and latency; audit events explain individual decisions. The OWASP logging guidance provides a useful basis for deciding which data belongs in those records.

Our article on testing gateway outcomes against backend observations develops this evidence model further.

API security becomes easier to review when each important restriction has an owner, an enforcement point and a test attached to the deployed version. That provides a concrete basis for evaluating a new endpoint, a gateway policy change or a WAAP deployment.

References

← Back to all articles

Contact Info

Send us a message

Tell us about your application, infrastructure or security requirements. All fields below are required.

Protected by our own security check.