← All Insights

OpenFGA – Open Source Fine-Grained Authorization by Auth0

Authorization is one of the most commonly under-engineered aspects of production systems. Most applications start with simple role-based access control and eventually find themselves fighting a growing tangle of permission logic embedded across services.

OpenFGA is a fast, scalable, and flexible authorization system developed by Auth0/Okta as open-source software. It is inspired by Google's Zanzibar paper, the system Google uses to manage authorization across all its products. This article explains what OpenFGA is, how it works, and when you should reach for it.


Authentication vs Authorization

These two concepts are often conflated but address entirely different problems.

Authentication answers "Who are you?" It verifies identity through passwords, tokens, or certificates.

Authorization answers "What can you do?" It determines which resources a user can access and which actions they can perform.

Authorization encompasses:

  • Which system entities a user can access
  • Which URLs are available to that user
  • Which action types are permitted (create, read, update, delete)
  • How permissions are granted and revoked

Most authentication problems are solved by established tools like Auth0, Cognito, or Keycloak. Authorization is where teams build custom, ad-hoc logic that quickly becomes difficult to maintain.


What is OpenFGA?

OpenFGA is a fine-grained authorization solution that models permissions as relationships between users, objects, and actions. Rather than checking "does this user have the admin role?", OpenFGA answers "does user X have relation Y to object Z?"

This relationship-based model (called ReBAC, or Relationship-Based Access Control,) is more expressive than traditional role-based access control and scales to complex, real-world authorization requirements without the sprawl of if/else permission checks.


Key Building Blocks

The OpenFGA Server functions as a permission engine. It exposes HTTP APIs for defining authorization models, querying relationships, and checking permissions. Storage is modular: it supports in-memory storage for development and PostgreSQL for production.

OpenFGA Clients are SDKs available for Go, .NET, and JavaScript that allow your application to interact with the server. Clients work with stores, which contain authorization data as relationship tuples.


A Practical Example: Project Management System

Consider a project management system where different roles have different permissions. Here is how you would model it in OpenFGA:

Authorization Model:

type project
  relations
    define creator as self
    define approver as manager from creator
    define team-member as self or creator or approver

type employee
  relations
    define approver as self or manager

This model defines that a project's approver is derived from whoever manages the creator, a relationship that would need complex JOIN queries or embedded permission logic in a traditional system.

Relationship Tuples:

  1. John manages Smith → John becomes Smith's approver automatically via the model
  2. Smith creates a project → Smith has the creator relation on that project
  3. Jane is added as a team member → Jane gains team-member access to the project

To check if a user can access a resource, the Check API returns a simple true/false based on user, relation, and object parameters. The complex graph traversal happens inside OpenFGA, not in your application code.


When to Use OpenFGA

OpenFGA is well-suited for systems where:

  • Permissions are relationship-based and context-dependent
  • Access rules need to be updated at runtime without code deploys
  • Multiple services need to share a consistent authorization layer
  • The current permission system is becoming hard to reason about

It is probably overkill for simple applications where basic role checks suffice. The overhead of running and maintaining a separate authorization service needs to be justified by the complexity of your permission requirements.


Conclusion

Authorization complexity grows with product complexity. Systems that start with simple role checks evolve toward nuanced, relationship-based permissions that are difficult to maintain when embedded across services.

OpenFGA gives you a principled approach to that problem: a dedicated authorization layer based on proven concepts from Google's Zanzibar, available as open-source software that any team can adopt and run.

If you are designing a new system or refactoring messy permission logic, OpenFGA is worth serious consideration.