Proof Key for Code Exchange (PKCE) extends the OAuth 2.0 authorization code flow. The client generates a proof key that protects the exchange of an authorization code for a token, adding protection against certain attacks. section 25.1.3
Use PKCE to distinguish common OAuth 2.0 scenarios:
- Favor authorization code with PKCE when a user initiates an interactive authorization flow. section 25.1.3 section 25.7
- Use client credentials instead when one API calls another without a user. section 25.1.3 section 25.7
- Treat PKCE as authorization protection, not as authentication; OpenID Connect adds authentication to OAuth 2.0. section 25.1.3
Interactive photo access
A user authorizes dogphotos.com to access photos through Facebook. The application uses the authorization code with PKCE flow to obtain a token, while the proof key adds protection to the code exchange. section 25.1.3




