Skip to content

Realms, Scopes, and Permissions

This document describes the access control design for the Arda Platform, including HTTP security realms, OAuth2 scope hierarchy, user roles, and tenant-based data scoping.

TermDefinition
RealmA named set of protected HTTP resources defined statically at design time. Access decisions are RBAC-based (role checked against realm definition).
AuthenticatorA mechanism to authenticate a request: Bearer Token, JWT, OAuth2, etc.
OAuth2 ScopeA named permission encoded into the JWT access token, controlling what API endpoints and operations a client is authorized to use.
Application ScopeA dynamic set of data resources restricted to authorized users; defined at runtime. Access decisions are ABAC-based (user attributes matched against resource attributes).
RBACRole-Based Access Control: access decisions based on the user’s role against statically defined realm/class values.
ABACAttribute-Based Access Control: access decisions based on dynamic attributes of both the user and the specific resource. Tenant scoping is ABAC.

Four realms are defined for the initial implementation. Access is determined by the custom:role claim in the user’s JWT:

RealmAccess
PUBLICAny request, including unauthenticated
FREEUsers with lite, subscriber, or admin roles
LICENSEDUsers with subscriber or admin roles
ARDAUsers with admin role only
RoleDescription
publicMinimal access; equivalent to unauthenticated interaction
liteAuthenticated user with freemium capabilities
subscriberRegular user with a commercial subscription
adminArda-affiliated users with full access
systemInternal system processes

Custom scopes declared on the Cognito Resource Server. Each scope implicitly includes access to all less-privileged scopes:

system > arda > subscription > lite > public

Standard OIDC scopes used by the Web Client: openid, email, profile, phone

Data entities in the system are assigned to one of two Application Scopes:

Scope KindDescription
GLOBALAccessible by any user with the required Realm access
TENANTAccessible only to users associated with the owning Tenant. Users with admin role can access all Tenant scopes.

A user may be associated with zero tenants (GLOBAL-only access) or one or more tenants (multi-tenant user; future capability).

The Web Client enables the following scopes: openid, email, profile, phone, tenant, role

The custom tenant and role scopes ensure these custom attributes are included in the issued tokens.

AttributeJWT ClaimDescription
User IDsubAlways included
EmailemailIf email scope requested
Full namenameIf profile scope requested
Tenant IDcustom:tenant<tenant-name>::<tenant-uuid>
Rolecustom:roleOne of public, lite, subscriber, admin, system
  1. More granular roles for fine-grained RBAC; tenant-configurable roles
  2. Multi-tenant user associations qualified by per-tenant roles and access conditions
  3. Facility-level or geography-based sub-scoping within tenants
  4. Evaluate Cedar as an authorization policy language