IAM and SSO ยท 16 due
OAuth 2.0 Security predicted recall 0%

What is the 'confidential client' vs 'public client' distinction in OAuth 2.0, and why does it matter for SSO security?

# PKCE flow (required for public clients) # 1. Client generates code_verifier (random string) code_verifier = "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk" # 2. Client sends code_challenge (SHA-256 hash of verifier, base64url) code_challenge = "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM" GET /authorize?client_id=spa&code_challenge=...&code_challenge_method=S256 HTTP/1.1
Answer

A confidential client is an application that can securely store a client secret (like a server-side web app), so it authenticates to the authorization server using both its client_id and client_secret. A public client cannot keep secrets securely (like SPAs, mobile apps, or JavaScript running in browsers), so it only identifies with client_id and uses alternative methods like PKCE (Proof Key for Code Exchange). This matters because: public clients are vulnerable to authorization code interception attacks. PKCE adds a cryptographically random 'code_verifier' generated by the client and a 'code_challenge' sent during authorization, verified later during token exchange. Without PKCE or client secrets, an attacker could steal the authorization code and exchange it for tokens.

How did you do?