Auth: exchange a provider token (Steam, Google Play, OIDC) for a SpacetimeDB identity #31
Labels
No labels
area:defold
area:docs
area:infra
area:protocol
area:testing
kind:bug
kind:chore
phase:breadth
phase:core
phase:hardening
phase:slice
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
yuris/spacetimedb-defold#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The SDK handles the token it is given and persists the one the server issues. It has nothing for the step before that: turning a platform identity into a SpacetimeDB token. Today every consumer shipping past a prototype writes this themselves.
The Godot SDK ships it as a first-class feature:
SpacetimeAuth(provider-agnostic OIDC exchange for Steam, Google Play, Epic; bounded retry with exponential backoff; timeout; credential redaction in logs) plus aJwtHelperthat decodes unverified JWT claims to cache tokens per provider (nodes/spacetime_auth/spacetime_auth.gd,util/jwt_helper.gd).Why this belongs in the SDK rather than in every game
Anonymous identity is fine until the player reinstalls, plays on a second device, or clears browser storage — then #17's persistence guarantees nothing, because the identity was never tied to anything but local storage. Every real game needs a durable identity, and the exchange is fiddly in the same ways for everyone: retries, timeouts, not logging the credential, caching per provider so a relaunch does not re-exchange.
The Defold pieces already exist:
http.requestfor the exchange, and the injectable storage seamstdb.sys_storagefor the cache.Scope
connect{ token = ... }Explicitly out of scope: bundling any platform SDK. Obtaining a Steam ticket or a Play token is the game's job with the platform's own extension; this issue starts from "here is a provider token".
Acceptance
Unit tests against a stubbed HTTP seam covering success, retry-then-success, exhausted retries, timeout, and a malformed response. A documented worked example for one real provider. And a test asserting no credential or token appears in any log line the SDK emits.
Priority
Not a 1.0 blocker — a game can do this itself, and the SDK's job is arguably done once it accepts a token. But it is the most valuable item here for someone actually shipping, and the largest single gap against the peer SDK.
yuris referenced this issue2026-08-19 15:43:23 +00:00