Unified Attestation (UA) is an open-source, federated alternative to Play Integrity. This backend acts as both home backend X (app-facing) and device backend Y (attestation verifier). Federation is handled offline via stored trust anchors and verification keys.
- Backend API (
/apps/backend): Fastify + Prisma + PostgreSQL - Portal (
/apps/portal): Next.js + Tailwind - Shared types (
/packages/common) - Federation trust store: stored in Postgres, managed by admin UI/API
npm installcp .env.example .envdocker-compose up --buildBackend runs on http://localhost:3001 and portal on http://localhost:3000.
npx prisma generatecurl http://localhost:3001/api/v1/infocurl -X POST http://localhost:3001/api/v1/device/process \
-H "Content-Type: application/json" \
-d '{
"projectId":"com.example.app",
"requestHash":"<sha256 hex>",
"attestationChain":["<base64 DER cert0>", "<base64 DER cert1>"]
}'curl -X POST http://localhost:3001/api/v1/app/decodeToken \
-H "x-ua-api-secret: <apiSecret>" \
-H "Content-Type: application/json" \
-d '{
"projectId":"com.example.app",
"token":"<token>",
"expectedRequestHash":"<sha256 hex>"
}'- Default admin:
admin / admin - Admin creates app dev + OEM users
- App dev registers apps and retrieves API secret
- OEM registers device families + trust anchors
See config.yaml for JWT and security settings. Backend ID + signing key are stored in the database.
Env overrides:
npm run -w @ua/backend test/v1/challengeand/v1/verifyare removed. Use/api/v1/device/processand/api/v1/app/decodeToken.- App-facing auth uses API secrets per app (projectId == packageName).
- Federation list is now stored in DB and managed in the Admin UI/API.