Optional OpenID AuthZEN authorization provider for external PDPs

The idea is:

Add an optional authorization provider that uses the OpenID AuthZEN Authorization API 1.0 (Final, January 2026) to ask an external policy decision point (PDP) for access decisions. Examples of PDPs that can implement AuthZEN include OpenFGA, Cerbos, and Topaz.

n8n would act as a policy enforcement point (PEP). It would send authorization requests to the PDP over HTTP. Built-in RBAC stays the default. Operators select the provider with configuration only. No third-party code runs inside the n8n process, and no plugin loader is needed.

Configuration (proposed names, for discussion):

N8N_AUTHZ_PROVIDER=builtin           # default; current behavior
N8N_AUTHZ_PROVIDER=authzen           # use an AuthZEN PDP
N8N_AUTHZEN_PDP_URL=https://pdp.example.internal
N8N_AUTHZEN_AUTH=client_credentials  # or mtls
N8N_AUTHZEN_TIMEOUT_MS=250
N8N_AUTHZEN_FAIL_MODE=closed         # deny when the PDP is unavailable
N8N_AUTHZEN_CACHE_TTL_MS=5000

Mapping n8n to AuthZEN. The specification defines the request format but not the action vocabulary, so this mapping is part of the proposal:

n8n concept AuthZEN field Example
Authenticated user subject { "type": "user", "id": "42", "properties": { "globalRole": "member" } }
Scope being checked action { "name": "workflow:update" }
Workflow, credential, project, or data table resource { "type": "workflow", "id": "W1", "properties": { "projectId": "P7" } }
globalOnly flag and request metadata context { "globalOnly": false }

Endpoints used:

  • POST /access/v1/evaluation for a single check (the existing userHasScopes() call sites);
  • POST /access/v1/evaluations for batch checks, for example when rendering a list with many items;
  • POST /access/v1/search/resource for list filtering. It returns the IDs the user may access, so list endpoints still run one query.

Behavior:

  • Fail closed when the PDP errors or times out, unless the operator explicitly changes the mode.
  • Short deadlines on execution paths such as workflow start and credential decryption, because those paths run on workers and webhook processes.
  • Caching of decisions per user, action, and resource, with a configurable TTL and invalidation when permissions change in n8n.
  • Decision logging with the reason returned by the PDP, at least for denials.
  • PDP authentication with OAuth 2.0 client credentials or mutual TLS, as the specification recommends.

Implementation sketch for maintainers:

  • userHasScopes() in packages/cli/src/permissions.ee/check-access.ts delegates to the selected provider. The two REST middlewares (controller.registry.ts and public-api/public-api-controller.registry.ts) and the about 62 service call sites (38 non-test files) keep their current code.
  • Built-in RBAC remains the default implementation.

Open questions:

  1. Where should relationship data live? Option A: the PDP holds the relations, synchronized from n8n or from the identity system. Option B: n8n sends the needed attributes in subject.properties and resource.properties, and the PDP decides on those attributes. Which option fits n8n better?
  2. Should the scope-to-action mapping live in code, in documentation, or in configuration?
  3. Which cache invalidation approach fits n8n best?

Non-goals: authentication (login, SSO, LDAP), removing built-in RBAC, loading third-party code into the process.

My use case:

Our infrastructure team runs n8n as a shared platform for several teams. We want all access decisions in one central PDP, so that policies, audit, and revocation are managed in one place. Some rules are relationship-based and cannot be expressed with n8n’s built-in roles, for example “user U belongs to team T, and team T owns folder F”. Today we cannot enforce such rules across the UI, the REST API, workflow actions, and credential use without forking n8n.

I think it would be beneficial to add this because:

  • It uses an existing open standard (OpenID AuthZEN, Final) instead of a custom n8n-specific interface, so vendors can implement it once for all their users.
  • It keeps one client in n8n for all compliant PDPs, instead of one integration per vendor.
  • It avoids loading third-party code into the n8n process and avoids changes to the module loader.
  • It keeps the change small in core: one delegation point (userHasScopes()) plus the list-filter path.
  • Built-in RBAC stays the default, so existing installations are not affected.

Any resources to support this?

Are you willing to work on this?

Yes, if the maintainers agree with the direction. I can prepare a pull request with:

  • a built-in AuthZEN client behind the provider selection;
  • the documented scope-to-action mapping;
  • conformance tests that run against an AuthZEN-compliant PDP;
  • a demo setup with n8n and OpenFGA as a reference scenario.