Enabling AuthZEN
To enable the AuthZEN endpoints, start the server with theauthzen experimental flag:
authzen.baseURL must be an absolute http or https URL and may include a path prefix, for example https://api.example.com/openfga.
All AuthZEN endpoints return an Unimplemented error if the experimental flag is not enabled.
Endpoints
All AuthZEN endpoints are scoped to a store. Evaluation and search endpoints are available under/stores/{store_id}/access/v1/. The Get Configuration (discovery) endpoint uses a different path: /.well-known/authzen-configuration/{store_id}.
Specifying an Authorization Model
By default, AuthZEN endpoints use the latest authorization model in the store. To pin requests to a specific model version, pass theOpenfga-Authorization-Model-Id header:
Evaluation
The Evaluation endpoint determines whether a subject is authorized to perform an action on a resource. It maps to the OpenFGA Check endpoint. Request:action.name must exactly match a relation defined on the resource type in your authorization model. For example, {"name": "reader"} checks the reader relation on the resource type.
You can also pass ABAC attributes and additional context — see ABAC Support below.
ABAC Support
Properties on the subject, resource, and action are automatically merged into the evaluation context with prefixes, enabling Attribute-Based Access Control (ABAC) with conditions:- Subject properties are prefixed with
subject_ - Resource properties are prefixed with
resource_ - Action properties are prefixed with
action_
subject_department, subject_clearance_level, resource_classification, and resource_required_clearance.
You can also pass context directly using the context field:
Evaluations
The Evaluations endpoint performs batch authorization checks in a single request. It supports request-level defaults for subject, action, resource, and context that can be overridden per evaluation item. Request:Overriding Defaults
Each evaluation item can override the request-level defaults:Evaluation Semantics
Theoptions.evaluations_semantic field controls how evaluations are processed:
When using
deny_on_first_deny or permit_on_first_permit, the response may contain fewer items than the number of evaluations in the request because processing short-circuits when the condition is met.
reader is permitted, only one evaluation response is returned.
If evaluations is omitted or empty, OpenFGA treats the request like a single Evaluation using the top-level subject, action, resource, and optional context, and returns a single-item evaluations array.
Subject Search
The Subject Search endpoint returns all subjects that have a specific action (relation) on a given resource. It maps to the OpenFGA ListUsers endpoint. This answers questions like “Who can read this document?” Request:subject field is required and must include type. If subject.id is provided, it is ignored (per AuthZEN Subject Search semantics).
Pagination is not currently supported for search endpoints. See Implementation Notes for details.
Resource Search
The Resource Search endpoint returns all resources of a given type that a subject has a specific action (relation) on. It maps to the OpenFGA ListObjects endpoint. This answers questions like “What documents can Anne read?” Request:resource field is required and must include type. If resource.id is provided, it is ignored (per AuthZEN Resource Search semantics).
Pagination is not currently supported for search endpoints. See Implementation Notes for details.
Action Search
The Action Search endpoint returns all actions (relations) that a subject can perform on a specific resource. This is useful for building dynamic UIs that show only the actions a user is permitted to perform. This answers questions like “What can Anne do with this document?” Request:Pagination is not currently supported for search endpoints. See Implementation Notes for details.
Get Configuration
The Get Configuration endpoint returns PDP discovery information per AuthZEN specification section 9.2.2. It provides the PDP identifier URL and absolute endpoint URLs for that store. Each store has its own discovery endpoint. The returned absolute URLs are built from the configuredauthzen.baseURL value, not from the incoming request’s Host, X-Forwarded-Host, or similar headers. This ensures discovery metadata stays bound to the canonical origin you configured.
Request:
authzen.baseURL is not configured, the discovery endpoint returns an error instead of inferring a base URL from request headers.
Mapping AuthZEN to OpenFGA Concepts
The AuthZEN API uses its own terminology that maps directly to OpenFGA concepts:Implementation Notes
The OpenFGA AuthZEN implementation follows the AuthZEN Authorization API 1.0 specification with a few adaptations for multi-tenancy. This section documents the key differences.Multi-tenant URL paths
The AuthZEN spec defines endpoints at/access/v1/evaluation, /access/v1/evaluations, etc. Because OpenFGA is multi-tenant, all endpoints are scoped under /stores/{store_id}/:
Response context fields
The spec allows an optionalcontext object in evaluation responses to convey additional information such as reasons, obligations, or UI hints. Per the spec, context is an arbitrary JSON object whose format is implementation-defined.
The current implementation:
- Does not populate
contextin successful evaluation responses - Does populate
context.error(withstatusandmessage) for individual failures in batch evaluations:
Identifier validation constraints
The AuthZEN spec modelssubject.type, subject.id, resource.type, resource.id, and action.name as strings. OpenFGA applies additional OpenFGA identifier constraints (pattern and length checks). Constraints are field-specific.
Pagination
The spec defines optional pagination for search endpoints using opaque continuation tokens (next_token). The current implementation does not support pagination — all matching results are returned in a single response. The page field in search requests is accepted but ignored.
PDP metadata fields
The AuthZEN metadata model defines optional fields such ascapabilities and signed_metadata. The current implementation returns endpoint metadata fields but does not expose signed_metadata and does not currently advertise capability URNs.
Authorization model selection extension
The AuthZEN spec does not define a standard way to pin requests to a specific model version. OpenFGA addsOpenfga-Authorization-Model-Id as an OpenFGA-specific request header extension.
X-Request-ID header
The spec RECOMMENDS that PEPs include anX-Request-ID header in requests and that PDPs echo it back in responses. OpenFGA returns an X-Request-ID header in all responses but does not currently echo back client-provided request IDs.
Contextual Tuples
The AuthZEN spec does not define a concept equivalent to Contextual Tuples. If your authorization model depends on contextual tuples for certain checks, you must use the native OpenFGA API for those checks.Related Sections
Learn more about the concepts and APIs used by the AuthZEN integration.Relationship Queries
Learn about the underlying Check, ListObjects, and ListUsers APIs.
Conditions
Learn how to use conditions for attribute-based access control.
Contextual Tuples
Learn about temporary relationship tuples for request-scoped authorization.