V23 · Firebase Auth

Custom claims chỉ mở vai trò, không mở dữ liệu thô.

Role trong Firebase Auth giúp route guard biết actor là ai; consent gate vẫn quyết định dữ liệu nào được dùng.

Hợp đồng claims

Custom claims mở vai trò/route; không cấp quyền vượt consent gate hoặc đọc dữ liệu cá nhân thô.

Bắt buộc:

  • role
  • cohortIds

Cấm:

  • rawR4Score
  • diagnosis
  • privateReportAccessAll

Assignment mẫu

{
  "uid": "p-demo-001",
  "claims": {
    "role": "participant",
    "cohortIds": [
      "cohort-demo-001"
    ]
  },
  "reason": "Thiết lập vai trò Firebase Auth cho Exixt; consent vẫn được kiểm tra riêng.",
  "assignedBy": "admin-demo",
  "assignedAt": "2026-06-11T20:41:12.539Z"
}