Skip to main content

medOS Auth (AAA)

Internal scope: ever-api-aaa · Authentication, Authorization & Accounting for the whole platform.

The AAA service is the identity and access-control authority for medOS. It owns user accounts, role/role-group/permission definitions, JWT issuance and refresh, page- and menu-level access control, third-party (OAuth / SMART-on-FHIR) app access, and an audit trail of authentication activity. It also hosts the optional biometric attestation endpoints (face and voice) used for staff login and clinician order sign-off. Every other microservice trusts the JWTs this service mints.

~28
modules
JWT
token model
RBAC
access model
Face + Voice
biometric (opt-in)

Responsibilities

  • Authentication — login, logout, token refresh, and JWT issuance/verification.
  • Authorization (RBAC) — users, roles, role-groups, permissions, and action-level ACLs resolved into the claims carried by each JWT.
  • Surface access control — page-, menu-, and medical-record-menu access tied to roles, plus e-form category and department scoping.
  • Third-party access — OAuth / SMART-on-FHIR app registration and scoped tokens for external app launches.
  • Accounting / audit — append-only audit logging and status-trail history of auth-relevant events.
  • Biometric attestation (optional) — face login and voice verification, each behind its own feature flag and subscription entitlement.

Major modules

ModulePurpose
authCore authentication — login, logout, refresh, JWT verify, biometric endpoints
user / hcisUserUser account management (two model generations)
role / hcisRoleRole definitions
roleGroup / hcisRoleGroupRole grouping for hierarchical RBAC
userRoleUser-to-role assignment
hcisPermissionPermission catalog
action / actionPermissionActions and action-level ACLs
hcisPage / menu / menuPermissionPage and navigation-menu access control
menuMedicalRecord / roleMenuMedicalRecordMedical-record menu scoping per role
eformCategoryPermission / eformDepartmentE-form category and department access
accessThirdParty / accessThirdPartyTokenOAuth / SMART-on-FHIR app registration and tokens
accessToken / refreshTokenToken issuance and refresh records
apiKeyConsoleAPI-key management console
userDepartment / userJobWorkStaff department and job-assignment mapping
auditLog / statusTrailHistoryAuth audit trail and status history
bulkOpsBulk user/role administration
_sequence / _settingInternal sequence and settings helpers

Token & sign-in flow

Client ── POST /v2/aaa/auth/login ──▶ Auth (AAA)
│ verify credentials
│ resolve roles → permissions

issue JWT (+ refresh)

◀──────── access + refresh ──────┘

Subsequent calls:
Client ── Bearer JWT ──▶ Gateway ──▶ any microservice (claims trusted)
Client ── POST /v2/aaa/auth/refresh ──▶ Auth (AAA) ──▶ new access token

Biometric attestation (optional)

Two opt-in modalities live on the auth module. Both ship off by default and require an explicit feature flag plus a subscription entitlement; an unentitled request returns a FEATURE_NOT_ENTITLED error.

Face login (FACE_LOGIN_ENABLED)Voice attestation (VOICE_LOGIN_ENABLED)Default-OFF + entitlement-gated
  • Face — challenge / sign-in / enroll endpoints. A single-use liveness challenge precedes a face login that verifies a posted face embedding; enrollment is part of the user-management add-user wizard.
  • Voice — challenge / verify / enroll endpoints. Voice verification is used for clinician attestation on AI-assisted order sign-off (it files an attestation on the order, it is not a session login).

See Feature entitlement for how the subscription tier gates these capabilities.

Config flags

FlagEffect
FACE_LOGIN_ENABLEDEnables the face challenge / sign-in / enroll endpoints
VOICE_LOGIN_ENABLEDEnables the voice challenge / verify / enroll endpoints
SUBSCRIPTION_TIERResolves whether biometric features are entitled for the tenant
  • ST-1ST-8 — User Account, Access Control, Audit, OAuth / Third-Party Access
  • SEC-7 — Biometric attestation (face / voice)
  • SEC-8 — SMART-on-FHIR scope guard
  • CP-1, CP-2 — User & Role Management