Authentication Scheme Classification
Classify exactly how each endpoint proves identity, because authorization testing is meaningless until you know what credential the check consumes
Use when: an API mixes cookies, bearer tokens, API keys and signed requests across different route groups
Avoid when: one single credential type is used everywhere and already documented in the platform guide
Procedure
- Identify the credential accepted by each route group: cookie, authorization header, API key header, query parameter or mutual TLS.
- Determine whether the credential identifies a user, a tenant or a machine, since each implies a different authorization question.
- Check where enforcement happens for each group: edge gateway, service mesh, framework middleware or handler code.
- Note which endpoints accept multiple credential types, because dual acceptance is a common source of inconsistent checks.
- Record transport requirements such as secure cookie flags, token binding and clock tolerance for signed requests.
- Feed the classification into your matrix so expected status codes reflect the credential each route actually consumes.
Signals
- One route group accepts both a cookie and a bearer token, which usually means two independent check paths exist.
- An API key identifies a tenant rather than a user, so per-user authorization may be missing entirely.
- A query-string credential appears, which tends to leak into logs, referrers and shared links.
- Enforcement differs between the gateway and the handler, and only one of the two knows about your new role.
Patterns
1. Scheme table
route group | credential | identifies | enforced-at
/api/session | cookie | user | gateway
/api/v2/* | bearer token | user | handler
/internal/* | service api key | tenant | gateway
2. Dual acceptance
/api/report accepts Cookie AND Authorization: Bearer
-> test both paths separately, results may diverge
3. Expected status
cookie missing -> 401
bearer missing -> 401
wrong tenant key -> 403
Pitfalls
- Testing authorization with a credential the route does not consume, which yields misleading 401s and no real signal.
- Assuming gateway enforcement covers handler logic, when internal routes frequently rely on the gateway alone.
- Overlooking query-string credentials that never appear in header-focused test tooling.
Done when
- Each route group has a credential type, an identity scope and an enforcement layer recorded.
- Dual-acceptance routes are listed explicitly so both paths get tested rather than one silently.