Folder: 00-Planning/. Builds on MVP1 (auth base, shell, H2/local, sessions).
GitHub: Project board · Milestone MVP2
Implementation notes: MVP2-IMPLEMENTATION.md
How to read this file (top → bottom):
- Scope — what MVP2 phase A includes / excludes
- Phase A detail — registration + Google SSO
- Work order — steps in sequence
- Checklist — mark done as we go
- Topic docs
- Next — MVP3.md (backlog moved)
- User registration — public self-signup; details in 03-security.md
- Google SSO (OIDC) — ID token from Google Identity Services → API verifies → same Platform session as password login
- Schema:
google_sub(unique, nullable),password_hashnullable for Google-only users - Web:
/register+ “Continue with Google” on/login - Keep existing session rules: opaque token,
token_hash, one active session per user, 24h / logout
Out of phase A (see MVP3.md)
- Email verification, invite-only, admin-created users
- Forgot / reset password; HttpOnly cookies / refresh tokens
- SAML or non-Google IdPs
- Roles admin GUI, theme switcher, i18n, landing kit, R2, etc.
- Payments / memberships (MVP3)
Already specified in 03-security.md (User registration). Summary:
| Item | Decision |
|---|---|
| Endpoint | POST /api/auth/register (public) |
| Body | personalId, email, password, confirmPassword |
| Role | Default USER only |
| After success | Auto-login → same LoginResponse shape as login |
| Web | /register; link from /login (“Create account”) |
| Not yet | Email verify, invite-only, CAPTCHA |
sequenceDiagram
participant User
participant Web as web
participant API as api
participant DB as DB
User->>Web: Submit register form
Web->>API: POST /api/auth/register
API->>DB: Reject if personal_id or email exists
API->>DB: Insert user BCrypt hash
API->>DB: Assign role USER
API->>DB: Create session 24h
API-->>Web: accessToken plus user
Web-->>User: Redirect /home
| Item | Decision |
|---|---|
| Provider | Google only (OIDC / ID token) |
| Front | Google Identity Services → credential (ID token) |
| API | POST /api/auth/oauth/google { "idToken": "..." } |
| Verify | aud = client id, iss Google, email verified, not expired |
| User | Find by google_sub; else by verified email (link); else create with role USER, no password |
| Session | Same as password login (revoke others → new session → opaque token) |
| Env | GOOGLE_CLIENT_ID (API + VITE_GOOGLE_CLIENT_ID on web) |
sequenceDiagram
participant User
participant Web as web
participant Google
participant API as api
participant DB as DB
User->>Web: Continue with Google
Web->>Google: GIS / OIDC
Google-->>Web: id_token
Web->>API: POST /api/auth/oauth/google
API->>Google: Verify id_token JWKS
API->>DB: Upsert user by google_sub or email
API->>DB: Revoke other sessions create session
API-->>Web: accessToken plus user
Web-->>User: Redirect /home
- Prefer stable key
google_subover email alone. - If email already has a password account → link
google_subon that row (same user, can use either login). - Google-only users:
password_hashnull; password login rejected with clear message (or “set password later” — backlog). - Never auto-grant
ADMINon register or Google signup.
Step-by-step Console guide (project, consent screen, Web client ID, cost notes, local env):
→ 01-Project Instructions/GOOGLE-SSO-SETUP.md
- OAuth client type Web application.
- Authorized JavaScript origins:
http://localhost:5173(+ prod URL later). - Never commit Client ID/secret to git.
| Step | What | Status |
|---|---|---|
| 1 | Flyway: google_sub unique nullable; password_hash nullable; entity/repo updates |
done |
| 2 | POST /api/auth/register + permitAll + validation + USER role + auto session |
done |
| 3 | Web: /register form + link from /login + toasts |
done |
| 4 | Config: GOOGLE_CLIENT_ID / VITE_GOOGLE_CLIENT_ID (local docs) |
done |
| 5 | POST /api/auth/oauth/google + ID token verifier + upsert/link user + session |
done |
| 6 | Web: Continue with Google on /login (and optionally /register) |
done |
| 7 | HOW-TO-RUN + OpenAPI notes for register + Google | done |
- Migration:
users.google_sub(unique, nullable) - Migration:
users.password_hashnullable - JPA
User+ repository lookups bygoogle_sub/ email
-
POST /api/auth/register - Validation (email, password policy, confirm match)
- Unique personalId/email handling
- BCrypt + role
USER+ auto-login session - Security: permit register path
- Route
/register - Form + link from
/login - Success → token →
/home; errors via toast
- Env / config for Google client id
-
POST /api/auth/oauth/google - Verify Google ID token server-side
- Create / link user + session
- GIS button on login (dark UI)
- Security: permit oauth path
- HOW-TO-RUN.md — register + Google setup
- Swagger shows new endpoints on
local
01-general.md · 02-springboot.md · 03-security.md · 04-frontend.md · 05-landing-pages.md · 06-api-optimization.md · MVP1.md
Auth detail for register + Google SSO: 03-security.md.
Phase A of MVP2 is done (register + Google SSO).
All former §6 backlog items and new billing/memberships work live in MVP3.md (and 07-payments-memberships.md).
GitHub: former issue #15 retargeted / superseded by MVP3 milestone issues.