Skip to Content
DocumentationGetting StartedAuthentication

Authentication

GoTamil API uses OIDC bearer tokens for user-facing endpoints and role-based access control to gate admin and operator operations.

Auth Mechanisms

MechanismUsed ForSource
OIDC BearerUser endpoints (proofread, essay-critique, admin)Authorization: Bearer <jwt>
Identity VerifierOperator/internal endpointsAuthorization: Bearer <jwt>
Internal Task AuthCloud Tasks workerX-Internal-Task-Token (dev) or Google OIDC (prod)
Supabase OAuthAdmin console sessionsGoogle Sign-In via Supabase

OIDC Token Requirements

Your JWT must include these claims:

ClaimDescription
issMust match configured issuer (default: https://nimir.internal)
audMust match configured audience (default: gotamil-api)
tenant_idYour tenant identifier (claim path is configurable)

Role claims are extracted from multiple possible paths: gotamil_roles, roles, role, app_metadata.gotamil_roles, or app_metadata.roles.

Roles

RoleAccess
tenant_adminFull tenant management — BYOK, certification, onboarding, dashboard
tenant_viewerRead-only — onboarding status, dashboard feed
service_integrationService account access for API endpoints
gotamil_operatorPlatform operator — invites, tenants, admin members

Endpoint Authorization Matrix

Endpoint GroupRequired Role
/v1/proofread, /v1/essay-critiqueAny authenticated user with valid tenant_id
/v1/operations/:idAny authenticated user (must match tenant)
/v1/admin/onboarding/*, /v1/admin/dashboard/*tenant_admin or tenant_viewer
/v1/admin/byok/*, /v1/admin/integrations/*tenant_admin
/v1/operator/*gotamil_operator
/v1/internal/*gotamil_operator

Production Safety

Production deployments enforce:

  • Unsigned dev tokens are blocked (OIDC_ALLOW_INSECURE_DEV_TOKENS=false)
  • JWKS public key set is required (OIDC_JWKS_JSON)
  • Internal task tokens must not use default values
  • Invite secrets must be at least 24 characters
  • Console URL must use HTTPS
Last updated on