A developer is implementing OAuth 2.0 for a mobile app (public client) that needs to access a user's data from a third-party API. To mitigate the authorization code interception attack, which OAuth 2.0 extension should be used?
Proof Key for Code Exchange (PKCE) enhances the Authorization Code Grant flow, making it secure for public clients like mobile applications that cannot securely store a client secret. It mitigates the authorization code interception attack by requiring the client to generate a cryptographically random `code_verifier` and a `code_challenge` derived from it. The `code_challenge` is sent with the initial authorization request, and the `code_verifier` is later presented when exchanging the authorization code for an access token, proving the client's identity without a shared secret.
Why this answer
PKCE (Proof Key for Code Exchange) is designed for public clients to prevent interception of the authorization code.