advancedSpring Security

What is PKCE and why is it required for SPAs and mobile apps?

PKCE (Proof Key for Code Exchange) has the client generate a random code_verifier and send its hash (code_challenge) with the initial auth request; when exchanging the returned code, it sends the original verifier, which the server hashes and compares. Since SPAs and mobile apps can't safely hold a client secret, PKCE replaces it, preventing authorization-code interception attacks.

This is a Pro question

Sign in, then upgrade to Pro or Power to unlock this question and the full Interview Prep bank.

What is PKCE and why is it required for SPAs and mobile apps?

Next Step

Continue to What is the difference between oauth2Login() and oauth2ResourceServer() in Spring Security?← Back to all Spring Boot & Microservices questions