Migrate from OpenFGA
Map your OpenFGA authorization model to WorkOS FGA resource types, roles, and permissions.
This guide helps you migrate from OpenFGA to WorkOS FGA. While both systems are inspired by Google’s Zanzibar paper, they take different approaches. OpenFGA uses relation-based access control (ReBAC) with explicit tuple storage, while WorkOS FGA uses hierarchical role-based access control (RBAC) with automatic permission inheritance.
| OpenFGA Concept | WorkOS FGA Equivalent |
|---|---|
| Types | Resource Types |
| Relations | Roles + Permissions |
| Tuples | Role Assignments |
| User sets | Organization Memberships |
Computed relations (from) | Native hierarchical inheritance |
| Contextual tuples | Check conditions in app code |
but not exclusions | Permission exclusions (coming soon) |
OpenFGA requires a schema DSL and explicit tuples for every relationship. WorkOS FGA simplifies this:
- Permissions flow down automatically – A role at a parent level grants access to all children without additional tuples
- Roles are scoped to resource types – Each resource type has its own set of roles
- Single parent per resource instance – Each resource instance has exactly one parent, creating predictable traversal paths
- No schema DSL – Configure resource types, roles, and permissions in the Dashboard
- Native WorkOS integration – Works seamlessly with AuthKit, SSO, Directory Sync, and IdP role assignment
Unlike standalone authorization systems, WorkOS FGA integrates natively with the WorkOS identity platform (although it can be used standalone):
- AuthKit Integration – Organization-scoped roles and permissions are embedded in access tokens for instant JWT-based checks
- IdP Role Assignment – Map identity provider groups (Okta, Azure AD, Google Workspace) directly to organization-scoped roles
- Directory Sync – Automatically provision and deprovision users with appropriate role assignments when group memberships change
- SSO – Enterprise SSO users get role assignments based on IdP group membership during authentication
Extract domain objects from your OpenFGA type definitions. These become resource types in WorkOS FGA.
Create resource types for:
- Business containers: organizations, workspaces, projects, environments
- Shareable entities: apps, pipelines, repositories, dashboards
Exclude:
type user– Use Organization Memberships as subjects insteadtype group– User groups are coming soon; for now, assign roles directly to users
Map OpenFGA parent relations to WorkOS FGA parent-child resource type relationships.
Create a project resource type with workspace as its parent. The parent relationship is defined at the resource type level.
When you register individual project resources instances via the API, they automatically inherit from their workspace. Permissions flow down this hierarchy without explicit tuples.
OpenFGA relations like viewer, editor, and admin become roles scoped to resource types.
Create roles on the project resource type:
| Role | Permissions |
|---|---|
| viewer | project:view |
| editor | project:view, project:edit |
| owner | project:view, project:edit, project:manage |
The or unions in OpenFGA become multiple permissions bundled into a single role.
{resource-type}:{action} for clarity. Each permission must be explicitly scoped to a resource type in the Dashboard – see more about permissions. When a role includes permissions scoped to child resource types (like project:view on a workspace role), it grants that permission on all child resources of that type.
OpenFGA computed relations using the from keyword are replaced by native hierarchical inheritance.
Create a workspace resource type with a role that includes child-type permissions:
| Role (on workspace) | Permissions |
|---|---|
| viewer | workspace:view, project:view |
When you assign workspace:viewer to a user, they automatically get project:view on all projects within that workspace. No explicit per-project tuples needed.
| OpenFGA Pattern | WorkOS FGA Equivalent |
|---|---|
| Direct user tuple | Role assignment on resource |
[type#relation] usersets | Role includes child-type permissions (automatic) |
or unions | Multiple permissions in a role |
and intersections | Check both conditions in app code |
but not exclusions | Permission exclusions (coming soon) |
OpenFGA contextual tuples allow passing runtime context with permission checks. With WorkOS FGA, handle these checks in your application code instead. This keeps the check interface simple and puts conditional logic next to the data it depends on.
Not everything belongs in FGA. We recommend using FGA for lower-cardinality resources (organizations, workspaces, projects) and handling high-cardinality entities (files, messages, comments) in your application.
Syncing millions of entities into FGA creates reconciliation overhead, race conditions, and consistency challenges. Instead, check access at the parent container level and filter entities in your application.
For detailed guidance on this pattern, including interceptor examples for nested entities, see High-Cardinality Entities.
- Define resource types in the WorkOS Dashboard matching your OpenFGA types
- Define permissions for each type (e.g.,
view,edit,manage) - Create roles that bundle permissions, including child-type permissions for inheritance
- Register resources via API when entities are created in your app
- Migrate tuples to role assignments on specific resources
- Replace OpenFGA checks with WorkOS FGA
checkAPI calls
Resource type hierarchy:
Roles for workspace:
| Role | Permissions |
|---|---|
| viewer | workspace:view, project:view |
| editor | workspace:view, workspace:edit, project:view, project:edit |
| admin | All workspace and project permissions |
Roles for project:
| Role | Permissions |
|---|---|
| viewer | project:view |
| editor | project:view, project:edit |
Organization members get workspace:viewer through an organization-scoped role. Workspace editors automatically get project:edit on all child projects through inheritance.
- Resource Types – Design your hierarchy
- Roles and Permissions – Configure inheritance patterns
- AuthKit Integration – Embed permissions in access tokens
- IdP Role Assignment – Map IdP groups to roles
- Assignments – Migrate your tuples to role assignments
- Access Checks – Replace OpenFGA check calls