Skip to content

Authentication models used by the dashboard and public APIs.

Legaciti exposes two different HTTP API surfaces with different security models.

The dashboard API is protected by Better Auth session authentication.

  • Canonical browser origin: https://my.legaciti.org
  • Sign in: https://my.legaciti.org/login
  • Better Auth routes: https://my.legaciti.org/api/auth/*
  • Intended audience: internal dashboard users and administrative tooling

Supported login methods:

  • Email and password (with email verification)
  • Google OAuth

When an endpoint requires dashboard authentication, the generated reference marks it with Better Auth Session.

Better Auth issues secure HttpOnly session cookies on sign-in. The browser attaches the cookie automatically to all same-origin requests. Non-browser clients can pass the session token as a Bearer token in the Authorization header.

Authorization is DB-backed:

  • app_users.is_superadmin controls superadmin access to /admin/* and site-tools
  • workspace_memberships controls per-workspace access

The public API is mostly read-only, with scoped API-key write endpoints for trusted partner automation.

  • Primary domain: https://api.legaciti.org
  • Read endpoints are public
  • POST /api/ingest requires an API key with ingest scope
  • POST /api/partners/people/:orcid/membership requires an API key with membership.update scope

Public API keys are sent in the X-API-Key header and validated by the worker against hashed key records.

The generated reference marks public endpoints as Public and API-key protected operations as API key.

  • Internal operational endpoints are included in the dashboard reference but marked as internal when they are administrative in nature.
  • The docs site publishes raw OpenAPI JSON so downstream tooling can consume the same machine-readable schema.