SPA (Authorization Code + PKCE)
Client-side PKCE flow — no client secret ever leaves the browser. A code verifier is generated locally, hashed to a challenge, and verified by Okta at token exchange.
1
Generate PKCE pair
Browser creates a random code_verifier and derives code_challenge = BASE64URL(SHA-256(verifier)).
2
Redirect to Okta
Browser sends code_challenge + code_challenge_method=S256 to the /authorize endpoint.
3
User authenticates
Okta shows the hosted Sign-In Widget. User enters credentials or uses MFA.
4
Code returned
Okta redirects back to /spa/callback with ?code=... Okta stores the challenge for verification.
5
Browser exchanges code
Browser POSTs code + original code_verifier to /oauth2/default/v1/token. No client secret needed.
6
Tokens decoded
Access token and ID token claims are decoded client-side and displayed below.
PKCE security note: The code_verifier is stored in sessionStorage only for the duration of the redirect. It is cleared immediately after the token exchange completes.
Sign In with Okta (PKCE)
Redirects via Okta hosted login — no client secret used