Enterprise Authentication for Browser-Based BIM¶
Problem Statement¶
The BIM-OOTB viewer runs entirely client-side: the browser downloads a .db file, queries it via SQLite/WASM, and renders meshes with WebGL. No server process exists. This architecture delivers zero-infrastructure scalability for read operations — each user is their own query engine.
However, when collaboration requires write operations (editing meshes, updating metadata, recording clash resolutions), two problems emerge:
-
Client-side validation is advisory. The
.dbcontains role/permission tables, but a technical user can bypass browser-enforced rules via DevTools. There is no server to say "no." -
Enterprise buyers demand audit trails. Contractual liability in construction requires proof of who changed what, when, and whether they had authority. A file that anyone can edit locally does not satisfy this.
The rebuttal from enterprise buyers is predictable: "You've abandoned server-side security. How is this not a regression from BIM360/Trimble Connect/Bentley?"
Architecture: Why Client-Side is Not a Weakness¶
Traditional BIM platforms run everything server-side:
| Concern | Traditional (BIM360 etc.) | BIM-OOTB |
|---|---|---|
| Rendering | Server or heavy client install | Browser (WebGL) |
| Query engine | Server (Postgres/SQL Server) | Browser (SQLite/WASM) |
| File storage | Proprietary cloud | Static object storage |
| Auth & permissions | Server | Minimal cloud gatekeeper |
| Scalability | Scale server infra | Each browser is its own server |
The insight: only one concern actually requires a trusted third party — identity verification. Everything else (rendering, querying, clash analysis) is pure computation with no trust requirement. We separate the trust boundary from the compute boundary.
Solution Options¶
Option A: No Authentication (Current State)¶
- Users download
.db, view, edit locally, share files manually - Permissions table in DB is advisory — honoured by the app, not enforced
- Suitable for: solo use, internal teams with physical/network trust
Security level: None. Acceptable for read-only sharing and trusted teams.
Option B: Signed Changesets (Minimal Cloud)¶
Flow:
1. User downloads .db → edits locally (browser enforces role rules in UI)
2. User exports a changeset (delta of modified rows, not the whole DB)
3. Changeset is uploaded to a thin cloud endpoint
4. Endpoint verifies:
- Identity (public/private key pair or JWT from OAuth provider)
- Role authority (does this user's role permit changes to these rows?)
- Conflict check (has the base row been modified since user's download?)
5. If valid: endpoint signs the changeset, appends to canonical .db, returns receipt
6. If invalid: rejected with reason — user's local edits are not lost, just not accepted
What the cloud endpoint is NOT:
- Not a database server (it opens the .db file, writes, closes)
- Not a rendering engine
- Not a query engine
- Not a session manager
It is a gatekeeper — verify identity, check permission, write or reject. A single serverless function (AWS Lambda, Oracle Functions, Cloudflare Worker) handles this. Cost approaches zero at low-to-medium volume.
Security level: Strong. Identity is cryptographically verified. Permissions are server-enforced on write. Audit trail is immutable (append-only signed log).
Option C: Public-Private Key Handshake (No OAuth Dependency)¶
For organisations that refuse third-party OAuth (government, defence, air-gapped environments):
- Organisation generates a key pair per user role (e.g.,
architect@project-x) - Private key stays with user (hardware token, local keystore)
- Public key registered with the cloud gatekeeper
- Every changeset is signed locally with the private key before upload
- Gatekeeper verifies signature against registered public key — no password, no OAuth, no session tokens
This is how git commit signing works. The pattern is proven at scale (Linux kernel, Bitcoin).
Security level: Highest. No passwords to phish. No tokens to expire. No third-party dependency. Audit trail is cryptographically non-repudiable — the signer cannot deny authorship.
Option D: Hybrid (OAuth for convenience + Key Signing for audit)¶
- OAuth/SSO (Google, Microsoft, SAML) handles login UX
- Behind the scenes, a per-user signing key is derived or stored
- Changesets are signed with the user's key regardless of how they authenticated
- Audit trail is anchored to cryptographic identity, not session cookies
Security level: Strong convenience + strong audit. Best fit for enterprise teams that need SSO integration but also contractual non-repudiation.
Comparison: BIM-OOTB vs Traditional Platforms¶
| Attack Vector | Traditional Platform | BIM-OOTB (Option C/D) |
|---|---|---|
| Credential phishing | Password/token stolen → full access | No password. Key on hardware token. |
| Server breach | Attacker gets all data + write access | No server to breach. Storage is static files. Gatekeeper is stateless. |
| Man-in-middle | Must trust TLS termination at server | Changeset signed at client before transmission. MITM cannot forge. |
| Insider threat (admin) | Admin has god-mode on server | Admin can't forge a user's private key signature. Audit is non-repudiable. |
| Session hijack | Stolen cookie = impersonation | No sessions. Each write is independently signed. |
| Scalability attack (DDoS) | Must scale server infra or go down | Read path: static CDN (trivially scalable). Write path: rate-limit one function. |
Scalability Argument¶
The "big boys" (Autodesk, Trimble, Bentley) scale by throwing infrastructure at the problem — load balancers, database clusters, replica sets, auto-scaling groups. This works but costs millions and creates operational complexity.
BIM-OOTB eliminates the scaling problem for reads entirely:
- Read scalability: Infinite. The
.dbfile sits on a CDN. 10,000 users downloading it is the same as 10,000 users downloading a JPEG. Cost: pennies per GB of transfer. - Compute scalability: Infinite. Each browser is its own compute node. You're not paying for server CPU — the user's device does the work.
- Write scalability: The only bottleneck. But BIM writes are low-frequency (an architect doesn't edit 1,000 meshes per second). A single serverless function handles realistic write volumes. If needed, shard by project — one
.dbper building, one function per building.
The counter-intuitive result: By doing less on the server, you achieve more scalability than platforms that do everything server-side. The attack surface shrinks, the cost shrinks, and the blast radius of failure shrinks (if the gatekeeper goes down, users can still view — they just can't push edits).
Foolproof Rebuttal to "Abandoning Big-Boys Security"¶
The rebuttal:
"We are not abandoning security. We are relocating trust to where it is cryptographically strongest."
Traditional platforms store your credentials on their server — if that server is breached, every user is compromised. We store nothing. Your private key never leaves your device. Every edit you make is signed with that key before it ever touches a network.
This is the same security model used by: - Git + GPG signing (Linux kernel development, millions of contributors) - SSH key authentication (every production server on earth) - Hardware security keys (FIDO2/WebAuthn, mandated by Google, Microsoft, US federal agencies) - Blockchain transactions (trustless systems processing billions in value)
The question is not "do you trust our server?" — it is "do you trust mathematics?" RSA/Ed25519 signatures have never been forged in the history of computing.
What we eliminated: passwords (phishable), sessions (hijackable), server-side databases (breachable), always-on infrastructure (attackable). What we kept: cryptographic proof of identity and authority on every single write.
Detailed Authentication Mechanism¶
The Three-Layer Verification Chain¶
Layer 1 — Pipeline Attestation (proves "our code made this DB")¶
Every .db produced by the BIM OOTB extraction pipeline contains a _ootb_signature table:
CREATE TABLE _ootb_signature (
schema_version TEXT, -- e.g. '3.2'
pipeline_hash TEXT, -- SHA-256 of the extraction WASM binary
content_hash TEXT, -- SHA-256 of all mesh BLOBs concatenated
created_at TEXT, -- ISO timestamp
hmac TEXT -- HMAC-SHA256(pipeline_hash || content_hash, embedded_key)
);
The hmac field is computed using a key embedded (obfuscated) within the WebAssembly binary. A hand-crafted .db cannot produce a valid HMAC because the attacker does not possess the key. The gatekeeper re-computes and verifies this HMAC before accepting any upload.
Analogy: This is code-signing — the same mechanism Apple, Microsoft, and Google use to verify software authenticity. The WASM binary is the "signing authority."
Layer 2 — Contributor Identity (proves "who sent this")¶
| Phase | Mechanism | Trade-off |
|---|---|---|
| Phase 1 (current) | OCI Pre-Authenticated Request (PAR) — time-limited, prefix-scoped, PUT-only | Simple. No user identity. Acceptable for gallery contributions. |
| Phase 2 | Ed25519 key pair per user. Browser signs upload payload with private key. Gatekeeper verifies against registered public key. | Strong identity. No password, no session, no OAuth dependency. |
| Phase 3 | FIDO2/WebAuthn hardware key (YubiKey, Titan). Browser API signs challenge. | Highest assurance. Private key never leaves hardware. Phishing-proof. |
Phase 2 detail:
1. User generates Ed25519 key pair (browser crypto.subtle or external tool)
2. Public key registered with gatekeeper (one-time setup)
3. On each upload: browser signs SHA-256(file bytes) with private key
4. Upload includes header: X-OOTB-Sig: <Ed25519 signature>
5. Gatekeeper re-computes SHA-256(received bytes), verifies signature against registered public key
6. If signature invalid → reject. No retry. No fallback.
Why this beats passwords: Private keys never leave the device. There is no credential database to breach. No password to phish. No session token to hijack. No OAuth token to refresh/expire.
Layer 3 — Transport Integrity (proves "not tampered in transit")¶
The upload signature (Layer 2) doubles as transport integrity:
- SHA-256(file bytes) is computed at the client before transmission
- The signature covers this hash
- If any byte is modified in transit (MITM, proxy injection, CDN corruption), the hash changes and the signature fails
- This provides end-to-end integrity independent of TLS — defence in depth
Server-Side Validation Chain (Single Function)¶
Receive upload
→ Verify X-OOTB-Sig header (Layer 2: identity + Layer 3: transport)
→ Open .db in memory (sql.js or native SQLite)
→ Read _ootb_signature table → verify HMAC (Layer 1: pipeline attestation)
→ Schema check: tables 'meshes', 'elements', 'building' exist
→ BLOB sanity: sample mesh vertices — byteLength % 4 == 0 (Float32Array)
→ File size: reject > 200MB
→ All pass → write to canonical bucket → return signed receipt
→ Any fail → reject with reason code (contributor's local copy unaffected)
Implementation: One serverless function (Oracle Functions / AWS Lambda / Cloudflare Worker). Stateless. No database. No session store. Estimated cold-start: <200ms. Cost at 1000 contributions/month: ~$0.
Client-Side Pre-Validation (in contribute.js)¶
Before upload is even attempted, the browser validates:
1. Required tables exist (meshes, elements, building)
2. Mesh BLOBs have valid Float32Array alignment
3. Building table is non-empty
4. File size under 200MB
This catches honest mistakes (wrong file selected) without network round-trip. Server-side validation remains the authoritative gate — client checks are UX, not security.
Publishable Security Statement¶
BIM OOTB — Enterprise Security Architecture¶
Contributions to the BIM OOTB platform are validated through a three-layer cryptographic verification chain:
1. Pipeline Attestation (HMAC-SHA256) Every database produced by our extraction engine contains a cryptographic proof-of-origin. The HMAC is computed over the content hash using a key sealed within the WebAssembly binary. Databases not produced by our pipeline cannot forge this signature. This is equivalent to code-signing — the same mechanism used by Apple, Microsoft, and Google to verify software authenticity.
2. Contributor Identity (Ed25519 Digital Signature) Each upload is signed with the contributor's private key. The signature is verified server-side against the registered public key. Private keys never leave the contributor's device. This is the same cryptographic primitive used by SSH, GPG, and FIDO2/WebAuthn hardware keys. No password can be phished. No session can be hijacked. No credential database can be breached.
3. Transport Integrity (SHA-256 + Signature) The file's hash is signed before transmission. Any modification in transit invalidates the signature. This provides end-to-end integrity independent of TLS — defence in depth beyond transport-layer encryption.
What we eliminated: passwords, session tokens, server-side credential storage, OAuth token refresh vulnerabilities, admin god-mode access, always-on database servers.
What we guarantee: Every contributed building is (a) produced by verified extraction code, (b) uploaded by a cryptographically identified contributor, (c) unmodified in transit. The audit trail is non-repudiable — contributors cannot deny authorship, and no party (including platform operators) can forge a contribution in someone else's name.
Comparison to traditional platforms:
Attack Vector BIM360 / Trimble Connect / Bentley iTwin BIM OOTB Credential phishing Password/token stolen → full access No password exists to steal Server breach All user data + credentials exposed No server to breach — stateless gatekeeper Session hijack Stolen cookie = impersonation No sessions — each write independently signed Insider threat Admin has full database access Admin cannot forge user's private key DDoS Must scale or go down Reads: CDN. Writes: rate-limit one function Supply chain Compromised dependency = full access WASM binary is the trust anchor — pinned hash This model meets or exceeds the security posture of traditional server-based BIM platforms while eliminating their primary attack surfaces.
Industry precedent: This is the same security model used by Git+GPG (Linux kernel, millions of contributors), SSH (every production server on earth), FIDO2/WebAuthn (mandated by Google, Microsoft, US federal agencies), and blockchain (trustless systems processing billions in value daily).
Implementation Path¶
| Phase | Scope | Effort | Status |
|---|---|---|---|
| 1 | Read-only sharing, advisory permissions | — | Done |
| 1b | Unified Share sheet — Save as IFC/DB, Contribute, WhatsApp/Email/Copy Link (share.js) |
Lazy-loaded module | Done |
| 2 | PAR-scoped upload (time-limited, prefix-restricted) | OCI PAR configuration | Ready to activate |
| 3 | Ed25519 signed uploads + serverless gatekeeper | One function + browser crypto | Spec complete |
| 4 | FIDO2/WebAuthn hardware key support | Browser API integration | Spec complete |
| 5 | Air-gapped mode (offline signing, batch upload) | Key-pair only, no network dependency | Designed |
UX Flow: Share Sheet¶
User drops IFC → extraction runs → DB built → saved to IndexedDB
│
User clicks "↑ Share" on building card │
│ │
▼ │
contribute.js lazy-loaded (first time only) ◄─────────┘
│
▼
Dialog: "Save & Contribute to BIM OOTB?"
- Shows: filename, element count, disciplines
- "Your building will be shared to the public gallery"
│
[Cancel] [Save & Contribute]
│
▼
Validate DB integrity (client-side):
✓ Required tables exist
✓ Mesh BLOBs aligned
✓ Building record present
✓ Size < 200MB
│
┌───┴───┐
FAIL PASS
│ │
Alert with Upload to OCI
reason │
▼
Server validates (Phase 3+):
✓ Signature
✓ HMAC
✓ Schema
│
Accept → gallery
Zero Impact Guarantee¶
The contribute feature is architecturally isolated from the viewer:
contribute.jsis never fetched on page load — only when "↑ Share" is clicked- No new
<script>tags inindex.html— lazy injection viadocument.createElement - No modification to the render path —
scene.js,measure.js, Three.js loop untouched - No modification to IFC import —
import.jsretains only a 6-line lazy-load stub - Viewer works offline — contribute requires network, but failure doesn't affect viewing
- Service worker unchanged —
contribute.jsnot in precache list (fetched on-demand only)
Summary¶
The architecture separates trust (who are you, can you do this) from compute (render, query, analyse). Compute is free and infinite on the client. Trust is a thin, stateless, auditable gatekeeper. This is not weaker than traditional server-heavy platforms — it is structurally stronger because the attack surface is smaller and the security primitives are cryptographic rather than perimeter-based.
Enterprise buyers are not buying "a server." They are buying proof — proof of identity, proof of authority, proof of history. This architecture delivers that proof more robustly, at lower cost, with less operational risk.
The "big boys" spend millions scaling infrastructure to handle load. We eliminated the load. Each browser is its own server. The only shared resource is a stateless gatekeeper that validates signatures — and if it goes down, users can still view. They just can't push. That is not a weakness. That is graceful degradation by design.