📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

Why does PKCE matter even for a confidential web app that has a client secret?

Mid-Level Theory Intermediate

🎯 Key points

  • Binds code exchange to the initiating session
  • Prevents authorisation code injection
  • The client secret doesn't help against injection
  • RFC 9700 recommends it for all clients; OAuth 2.1 draft requires it
  • UsePkce = true by default in ASP.NET Core

⏱ 30-second answer

PKCE binds the code exchange to the session that started the flow. Without it, an attacker who obtains a victim's authorisation code (from logs, a leaky redirect or a malicious app) can inject it into their own session with the confidential client, which redeems it with its own secret, so the attacker ends up logged in as the victim. The client secret doesn't help, because the legitimate client is the one redeeming the code. The OAuth 2.0 Security Best Current Practice (RFC 9700, January 2025) therefore recommends PKCE for confidential clients too, and the OAuth 2.1 draft requires it for all clients. ASP.NET Core's OIDC handler enables it by default (UsePkce = true).

🔍 What the interviewer is checking

Checks understanding of authorisation code injection, not just public clients

↩ Usually asked after

More in Authentication

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me