DEV Community

andreagomez
andreagomez

Posted on

FAPI 2.0 Is Not a Badge: Separating Identity Assurance from API Authorization

FAPI 2.0 Is Not a Badge: Separating Identity Assurance from API Authorization

FAPI 2.0 describes a high-security profile for OAuth 2.0 deployments that protect valuable APIs. The OpenID Foundation approved the final security profile in February 2025. The profile combines exact redirect handling, Pushed Authorization Requests, PKCE, asymmetric client authentication and sender-constrained access tokens. Its purpose is to make a specific attacker model harder to execute, not to certify every application that uses the same identity provider.

That distinction matters during architecture reviews. An authorization server may support FAPI 2.0 and still issue a token to a client that asks for too much authority. A resource server may validate a DPoP proof and still ignore the token audience. A bank may pass a conformance suite while an internal administrative API accepts the same token on a different path. The profile defines the protocol controls. The organization still has to define the authorization model.

Controls that belong to the authorization server

The authorization server should require Pushed Authorization Requests and PKCE for the authorization code flow. The authorization request should be bound to the client and the browser transaction, and redirect URIs should be compared exactly. Client authentication should use asymmetric keys, with key rotation and revocation that operators can perform without disabling every client.

Sender-constrained tokens should be visible in policy, logs and incident procedures. If the profile uses DPoP, the resource server must verify the proof, its key, its method and its URI, then bind that proof to the access token. If it uses mutual TLS, the certificate must be checked against the token binding and the certificate lifecycle must be linked to the client lifecycle. A gateway that checks a proof but forwards an unbound token has not preserved the FAPI property.

FAPI 2.0 also relies on the OAuth security baseline in RFC 9700. Exact redirect matching and the removal of insecure grants are not optional decorations around the profile. They are necessary for the attacker model to hold. During migration, the authorization server should be able to report which flow, client authentication method and token binding were used for each token.

Controls that belong to the resource server

The resource server has the final responsibility for deciding whether a token is suitable for a request. It should check the issuer, signature, expiry, audience, token type and the scope or authorization detail associated with the operation. It should reject an ID token presented as an access token, even if both are signed by the same issuer and contain similar claims.

Authorization should be tied to the resource and the action. A token scoped to read a customer record should not be accepted for a bulk export because both requests reach the same host. A token issued for one tenant should not become a cross-tenant administrator credential when a header or query parameter changes. These are application authorization failures, not OAuth protocol failures, but they determine whether FAPI's stronger token handling has any operational value.

The resource server should also preserve evidence. Log the token identifier or a stable hash, issuer, client, audience, scope, decision and the policy version used. Avoid logging the token itself. The record should be sufficient to investigate a disputed transaction without turning the log platform into another credential store.

Make conformance a repeatable test

Conformance testing should include negative cases. Try a redirect URI with an extra path segment, a token request with the wrong PKCE verifier, a DPoP proof for a different method, a token for another audience and a request that changes the tenant identifier after authentication. Confirm that each case is rejected for the intended reason.

Then test operational transitions. Rotate a client key, revoke a certificate, expire a DPoP key and disable a consent grant. Observe how quickly the resource server stops accepting the old authority and whether existing sessions fail closed. FAPI 2.0 is strong against protocol-level substitution when the implementation follows it. The engineering team still needs to prove that the production path from the browser to the database applies every check.

The practical rule is simple: treat FAPI 2.0 as a set of enforceable properties, not as a logo. The authorization server owns the issuance controls, the resource server owns the decision, and the security team owns the evidence that both sides agree on the same client, audience and authority.

References

Top comments (0)