# Auth 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

- Skill: `wsh7ash/auth-scheme-classification` (Agent Skill)
- Install (CLI): `npx get-skill add wsh7ash/auth-scheme-classification`
- Raw SKILL.md: https://api.skillmd.com/api/skills/wsh7ash/auth-scheme-classification/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: Wsh7Ash (https://skillmd.com/u/wsh7ash)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/wsh7ash/auth-scheme-classification

---


# 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

1. Identify the credential accepted by each route group: cookie, authorization header, API key header, query parameter or mutual TLS.
2. Determine whether the credential identifies a user, a tenant or a machine, since each implies a different authorization question.
3. Check where enforcement happens for each group: edge gateway, service mesh, framework middleware or handler code.
4. Note which endpoints accept multiple credential types, because dual acceptance is a common source of inconsistent checks.
5. Record transport requirements such as secure cookie flags, token binding and clock tolerance for signed requests.
6. 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**

```text
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**

```text
/api/report accepts Cookie AND Authorization: Bearer
-> test both paths separately, results may diverge
```

**3. Expected status**

```text
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.

## References

- [RFC 6750 - bearer token usage](https://www.rfc-editor.org/rfc/rfc6750)
- [OWASP API Security Top 10](https://owasp.org/www-project-api-security/)

