Demo and Quick Start¶
Try the hosted ChatLogin demo or template playground. These use public synthetic identities, not real business data.
chatlogin serve runs the product demo entirely from the installed ChatLogin wheel; it does not depend on source-relative files. Use it to choose an authentication backend, frontend integration level, and LoginUI configuration. It is not a shared production identity service.
Install and Run¶
The default address is http://127.0.0.1:8765/. The demo extra includes FastAPI, Starlette, Jinja2, and Uvicorn; the core package still does not force these web dependencies.
Usage: chatlogin serve [OPTIONS]
Options:
--host TEXT Bind address; loopback by default. [default: 127.0.0.1]
--port INTEGER RANGE TCP port. [default: 8765; 1<=x<=65535]
--origin TEXT Fixed trusted public origin for browser Host/Origin checks.
--managed-demo Serve the disposable managed-users demonstration.
--help Show this message and exit.
When a reverse proxy terminates TLS, keep the process on loopback and explicitly provide the origin browsers use:
--origin is fixed security configuration. It is never inferred from Host, X-Forwarded-Host, or X-Forwarded-Proto. Proxy policy, TLS, process supervision, and public rate limiting remain deployment responsibilities.
Managed Users Demo¶
Default chatlogin serve remains the four legacy-backend demo described on this page. To exercise the new instance-local owner/admin/user preset, select it explicitly:
It creates a current-process-only ManagedUsers.in_memory(...) lifetime that closes at shutdown, then uses real bootstrap_owner, authenticate, and create_user calls for three public synthetic owner, admin, and user accounts. Its landing page lists those deliberately public fixtures, role boundaries, and login/manage/profile entries; management and profile still use the default UserAdminUI / UserProfileUI and protected APIs. It reads no ChatEnv home/profile, production account database, or production sessions. GET /health contains only the installed version, mode: "managed-demo", and synthetic: true; GET /api/managed-demo/accounts contains only deliberately public synthetic values. See Managed Users.
What You Can Exercise¶
The development preview exposes public synthetic A/B accounts. Choose one in the login form and use Fill Demo. Neither identity maps to real customer data; see the isolation lab.
| Backend | Frontend | Entry | Data source |
|---|---|---|---|
PasswordBackend |
Default LoginUI |
/demo/password/ |
Two explicit synthetic accounts and password hashes |
CallbackBackend |
Host renderer override |
/demo/callback/ |
Local synchronous synthetic callback |
AsyncCallbackBackend |
ui=None + host HTML/JS |
/experience/async |
Local asynchronous synthetic callback |
ChatVoiceAuth |
Split/dark LoginUI |
/demo/chatvoice/ |
Disposable shared-memory SQLite legacy-schema fixture |
Each mode has a separate cookie name and session namespace. The post-login workspace renders a safe identity, host-owned synthetic records, real ownership checks, protected-read/CSRF checks, and logout actions. Pages and logs do not render session tokens, cookies, password hashes, or CSRF values. CSRF is returned only in same-origin session/login JSON for safe writes; session tokens are delivered through HttpOnly cookies.
The template playground at /templates is generated by real LoginUI.render(). It accepts only three palettes, two layouts, light/dark/system, and a guest toggle, then produces exact copyable Python configuration. It accepts no arbitrary HTML or filesystem path.
Health and version readback:
GET /health -> {"status":"ok","version":"<installed-version>"}
GET /version -> {"version":"<installed-version>"}
Multiple Accounts and Data Isolation¶
The A/B isolation lab is available starting in 0.1.6. The 0.1.5 authentication core already supports multiple accounts, but its bundled demo exposes only one identity. Check the site header or chatlogin --version.
| Layer | Owner | Verification |
|---|---|---|
| Multi-account authentication | PasswordBackend mapping, synchronous/asynchronous callbacks, or ChatVoiceAuth account database |
A/B resolve to distinct, stable user_id values |
| User sessions | ChatLogin session storage and HttpOnly cookies | Independent browser sessions do not mix identities; logging A out leaves B active |
| Business data | Host-side filtering and require_owner |
Own list/detail/write succeeds; A's session gets 403 for B's sample, and vice versa |
Every backend example has two public synthetic credentials: A uses demo / chatlogin-demo; B uses demo-b / chatlogin-demo-b. Choose and fill an account, then submit login. Two ordinary tabs share cookies and are not independent users. Use a normal and a private window, or separate browsers, for parallel verification.
The post-login data-isolation panel performs real own-read, own-write, other-read, and other-write API requests. The server changes the revision; it does not send everyone's data to the page and merely hide rows. Ownership comes from the trusted server-side Principal.user_id, never a client-supplied owner_id. The other sample ID is deliberately public for this synthetic authorization test, not a directory-enumeration pattern for real products.
This is application-level logical isolation, not a separate database per person. A ChatVoice host can also query (owner_id, record_id) and return 404 for details outside the current user's namespace. The login library cannot automatically isolate meetings, files, downloads, background jobs, or every business table: the host must authorize each entry point. Assign each real user a stable distinct user_id; mapping all account names to one Principal intentionally makes them the same identity.
Sample records exist only in the demo process and disappear on restart. They have no production privileges. Since both credentials are public, anyone can deliberately log in as either identity. The verified boundary is A's session cannot access B's resources, not confidentiality from a visitor who knows B's credentials.
Demo Security Boundary¶
- Each backend permits at most 16 live sessions with a five-minute TTL. Capacity exhaustion returns retryable HTTP 503 without evicting another live session.
- Memory modes live only in the current process. The ChatVoice fixture exists only for the shared-memory SQLite lifetime and writes nothing to a user home.
- Auth/private responses are
no-store; cookies areHttpOnly, fixed-path,SameSite=Strict, andSecurefor an HTTPS origin. - Every browser POST uses a fixed same-origin check. Repeat login with an existing cookie bootstraps session state and sends current CSRF before rotating.
- Allowlisted assets are loaded from package resources with correct content types; CSP requires no external CDN.
- The demo reads no ChatEnv profile, production provider, real account database, or arbitrary forwarded header.
Integrate a Real Project¶
Production hosts install ChatLogin[web] and choose their own CredentialBackend, SessionStore, fixed origin, and business authorization. Default UI, host override, and headless are independent frontend choices—not OAuth/SMS authentication protocols.
- Integration and Security: runnable FastAPI setup, template override, headless sequence, callbacks, ChatVoice schema, and stores.
- Capability Map: implemented and explicitly excluded behavior.
- Python Interface Tree: actual constructor signatures and HTTP routes.
ChatLogin provides no default production password, OAuth, SSO, MFA, email/SMS code, QR login, or cross-product identity center. Managed users provide only instance-local account administration; fixed accounts, callbacks, and the ChatVoice adapter still have no account console.