OAuth 2.0 & PKCE Flow
How Authorization Code with Proof Key for Code Exchange (PKCE) protects users and clients during sign-in.
End-to-End Sequence
- Initiation: Your application creates a per-request
statetoken (CSRF protection) and a PKCE pair (code_verifier→code_challengewithcode_challenge_method=S256), then navigates tohttps://auth.webburnstech.dev/oauth/authorize. - Authentication: If the user has no active Webburns session,
auth.webburnstech.devredirects tomyaccount.webburnstech.dev/auth/signinand returns cleanly once authenticated. - Publishing Gate: If the client is in
testingmode and the user is neither the owner nor in the allowlisted test users (up to 25 emails), Webburns blocks authorization with HTTP403. - Consent Screen: Users inspect the application name, Verified/Testing status, branding links (Homepage, Privacy Policy, Terms of Service), and requested scopes before clicking Allow.
- Authorization Code Callback: Webburns redirects back to your exact registered
redirect_uriwith?code=...&state=.... - Token Exchange: Your app posts
code,redirect_uri,code_verifier, and client credentials tohttps://auth.webburnstech.dev/oauth/tokenand receivesaccess_token,id_token, and token metadata.
PKCE Enforcement Rules
| Rule | Behavior on auth.webburnstech.dev |
|---|---|
| SPA & Native clients | Must send code_challenge and code_challenge_method=S256 on every /oauth/authorize request. Requests omitting PKCE or using plain are rejected. |
| Web clients | May optionally use PKCE (S256 recommended, plain accepted only for backwards compatibility if explicitly used). |
| Verifier verification | When an authorization code was issued with a code_challenge, /oauth/token requires the matching code_verifier verified via constant-time SHA-256 comparison. |
Integration Security Checklist
- Always validate the returned
stateparameter matches the browser session before calling/oauth/token. - Never embed
client_secretin frontend JavaScript bundles or native binaries; use aspaornativeclient with PKCE instead. - Register exact callback paths in Authorized Redirect URIs; wildcard redirect URIs are rejected.
- Use
/oauth/revokewhen a user signs out of your application.