On this page
    Protocol Guide

    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

    1. Initiation: Your application creates a per-request state token (CSRF protection) and a PKCE pair (code_verifier → code_challenge with code_challenge_method=S256), then navigates to https://auth.webburnstech.dev/oauth/authorize.
    2. Authentication: If the user has no active Webburns session, auth.webburnstech.dev redirects to myaccount.webburnstech.dev/auth/signin and returns cleanly once authenticated.
    3. Publishing Gate: If the client is in testing mode and the user is neither the owner nor in the allowlisted test users (up to 25 emails), Webburns blocks authorization with HTTP 403.
    4. Consent Screen: Users inspect the application name, Verified/Testing status, branding links (Homepage, Privacy Policy, Terms of Service), and requested scopes before clicking Allow.
    5. Authorization Code Callback: Webburns redirects back to your exact registered redirect_uri with ?code=...&state=....
    6. Token Exchange: Your app posts code, redirect_uri, code_verifier, and client credentials to https://auth.webburnstech.dev/oauth/token and receives access_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 state parameter matches the browser session before calling /oauth/token.
    • Never embed client_secret in frontend JavaScript bundles or native binaries; use a spa or native client with PKCE instead.
    • Register exact callback paths in Authorized Redirect URIs; wildcard redirect URIs are rejected.
    • Use /oauth/revoke when a user signs out of your application.