Specification: RFC 7636
PKCE (Proof Key for Code Exchange) prevents authorization code interception attacks. OAuth 2.1 mandates it for all clients; Versola enforces it on every authorization request regardless of client type.
Code Verifier
- Format validation:
[A-Za-z0-9._~-]characters only - Length validation: 43–128 characters (Section 4.1)
- Transmitted in token exchange as
code_verifier
Code Challenge
-
S256method:BASE64URL(SHA256(ASCII(code_verifier)))(Section 4.2) -
plainmethod:code_challenge = code_verifier(Section 4.2) - Stored server-side and tied to the authorization code
- Verified on token exchange before code is consumed
Authorization Request
-
code_challengeparameter — required (stricter than RFC: Versola rejects requests without it) -
code_challenge_methodparameter — optional, defaults toplainper spec - Invalid or missing
code_challengereturnsinvalid_requesterror
Token Request
-
code_verifierparameter — required when PKCE was used - Server rejects mismatched verifier with
invalid_grant - Replay protection: authorization code is single-use
Security Notes
Versola enforces PKCE on all authorization requests, not just public clients. plain is technically supported per RFC but S256 is strongly preferred and recommended.