API authentication is often quoted as a small add-on to an integration. In practice, it is a security boundary. The cost depends on who needs access, what they can see, which systems must be connected and how much evidence the business needs when something goes wrong.
A simple API with one partner and a static key is not the same as a multi-tenant platform with customer roles, mobile apps, partner scopes and a legacy ERP. This guide explains the scope drivers and a cost model you can use to compare proposals.
Authentication is not authorization
Authentication answers "who are you?" Authorization answers "what are you allowed to do?" Many projects implement the first and assume the second. The result is a user who can log in and then call an endpoint that returns another customer's order. OWASP's API Security Top 10 puts broken object-level authorization at the top of the list for a reason.
A proper design covers both: identity, session or token, roles, scopes, object ownership, tenant boundaries, admin access and audit.
The scope drivers
- Identity sources: internal users, customers, partners, service accounts and legacy accounts.
- Protocols: OAuth 2.0, OpenID Connect, SAML, API keys or a signed request scheme.
- Applications: web, mobile, partner portal, internal dashboard and machine-to-machine jobs.
- Authorization model: roles, scopes, attributes, tenant boundaries and object-level checks.
- Legacy systems: applications that cannot speak modern protocols and need a bridge.
- Token lifecycle: expiry, refresh, rotation, revocation and incident response.
- Audit and monitoring: authentication logs, authorization failures and alerting.
- Testing: negative tests for every role and every object boundary.
A cost model
Build the estimate from six lines:
- Design: identity flows, roles, scopes, tenant model and threat review.
- Implementation: identity provider integration, token handling, authorization checks and admin controls.
- Legacy bridge: the adapter or proxy needed for older applications.
- Testing: role matrix, object-level tests, token abuse cases and penetration testing.
- Operations: logging, alerting, key rotation, incident response and documentation.
- Migration: moving users and integrations without breaking active sessions.
The cheapest quote often covers only the second line. The expensive surprises are the legacy bridge, the role matrix and the testing.
Build versus buy
Use a managed identity provider when the requirement is standard: social login, MFA, SSO, user directory and standard OAuth flows. Build custom authorization when the business has a unusual tenant model, fine-grained object permissions or regulatory constraints that the provider cannot express.
Even with a managed provider, you still own the authorization logic in your application. The provider tells you who the user is. It does not know whether this user can see this invoice.
Questions to ask a vendor
- Which OAuth flows will be used, and why?
- How are roles and scopes modelled, and who approves changes?
- How is object-level authorization enforced and tested?
- What happens when a token is stolen, a user leaves or a partner is terminated?
- How are service accounts and machine-to-machine calls protected?
- What is logged, where, and for how long?
- How will the legacy application be bridged?
- What negative tests will be run before launch?
Common mistakes
- Using a static API key for every partner.
- Putting roles in the frontend and trusting the client.
- Checking the route but not the object:
/orders/{id}returns any order. - Long-lived tokens with no revocation path.
- No audit trail for admin or partner access.
- Testing only the happy path.
A worked scope example
Imagine a 60-person distributor with an ecommerce store, a small warehouse, a finance team and a legacy ERP. The first scope is not the whole company. It is the order-to-cash path: store, payment, warehouse, courier and ERP. The review covers four users, three systems, one payment provider and one courier API. The output is a role matrix, an object-level authorization test and a token lifecycle note.
That scope is small enough to finish and important enough to matter. A second phase can cover the customer portal and the partner API. Splitting the work this way keeps the first release focused and gives the business evidence before expanding.
What good evidence looks like
- A diagram of every API consumer and the identity flow it uses.
- A role matrix showing read, write and admin access by object.
- Negative test results for cross-tenant and cross-customer access.
- Token expiry, refresh and revocation settings.
- Audit logs for authentication and authorization failures.
- A documented recovery path for a lost device or a departed employee.
A 90-day plan
- List every API consumer: web, mobile, partner, internal job and admin.
- Draw the role and tenant matrix. Mark which objects each role can read and write.
- Choose the identity protocol and provider; document the flows.
- Implement object-level authorization checks and test them with negative cases.
- Add token expiry, rotation, revocation and audit logging.
- Run a security review and fix the top findings before launch.
Where this fits in our work
If you need an API security review or a new integration, start with Custom Software & Integrations. The pricing page explains scope. For the design checklist, read the REST API design checklist.
Sources
- OWASP API Security Top 10, 2023, accessed 17 November 2026.
- RFC 6749, The OAuth 2.0 Authorization Framework, 2012.
- NIST SP 800-63B, Digital Identity Guidelines, accessed 17 November 2026.
- OWASP Application Security Verification Standard, accessed 17 November 2026.
Responses (0)
No comments yet. Add the first one below.
Leave a response
Your email address will not be published. Required fields are marked *.