BYO UI (bring your own forms)
Tier C — own credential UI for registration, login, MFA, recovery, and verification while keeping Code+PKCE.
Wocha supports three integration tiers for authentication UI:
| Tier | Name | What you build |
|---|---|---|
| A | Hosted Universal Login | Redirect to id.wocha.ai |
| B | Headless redirect | Own buttons/chrome via @wocha/react / @wocha/ui — still redirects to hosted Auth |
| C | True BYO | Own forms that call BFF → Auth /api/auth/byo/* → Code+PKCE |
This guide covers Tier C. Full contract: byo-ui.md in the monorepo.
Requirements
- First-party OAuth client (
FIRST_PARTY_CLIENT_IDS) - Confidential BFF (
WOCHA_CLIENT_ID/WOCHA_CLIENT_SECRET/WOCHA_ISSUER) - Optional
WOCHA_AUTH_URL(defaultsoauth.*→id.*)
BFF routes (@wocha/nextjs, Remix, SvelteKit, Nuxt)
| Route | Method | Stage |
|---|---|---|
{authBasePath}/login | GET | Hosted OAuth start |
{authBasePath}/login | POST | BYO password login |
{authBasePath}/register | POST | BYO registration |
{authBasePath}/mfa/verify | POST | BYO MFA (TOTP / backup codes) |
{authBasePath}/recovery | POST | Forgot password (action: start | complete) |
{authBasePath}/verification | POST | Email verification |
{authBasePath}/passkey/continue | POST | Passkey session → OAuth continue |
After a successful credential stage the BFF returns { continueUrl } and sets the PKCE cookie. Navigate the browser to continueUrl (full page) to finish Code+PKCE.
Example — BYO login
Password change (signed-in)
Use the Account API via @wocha/react / @wocha/ui:
What stays hosted
Social/OIDC buttons, third-party consent, OAuth org-select, and forced policy settings remain on Auth. First-party clients skip consent automatically.