Releases on GitHub  ·  Apache-2.0  ·  September 2026
idp-auth-peps

Discover the PDP. Enforce its decision.

A Policy Decision Point (PDP) evaluates access policy for a request. These enforcement points discover the PDP for each API from published metadata. They send the request and the API's access requirements to that PDP using OpenID AuthZEN, a standard API for authorisation decisions. OpenID Federation lets a trusted federation authority restrict which PDPs a member API uses.

discovery 1

The gateway finds the PDP

The API's protected resource metadata names its PDP. The PDP's AuthZEN metadata identifies its evaluation endpoints. The gateway retrieves both documents.

discovery 2

The PDP evaluates the API's requirements

The gateway forwards the API's metadata with the request details. The PDP uses that metadata to check the required scopes and authentication level. The route can also forward the access token.

Configure the resource. Discover its PDP.

Configure the API's resource identifier and the discovery security settings on the gateway. Discovery reads PDP addresses and access requirements from published metadata. The table compares this with configuring those values on each gateway.

The gateway needs to knowManual configurationWith discovery
Which API it is protectingconfiguredconfigured - the resource identifier used for discovery
Which PDP decides for that APIconfigured (AUTHZEN_URL)read from the API's metadata, or from the federation
Where the PDP's endpoints areassumed (/access/v1/evaluation)read from the PDP's metadata
Which scopes and authentication level the API requiresconfigured on the gateway, compared by the gatewaypublished by the API, enforced by the PDP
Who controls the published metadatawhoever edits the gatewaythe federation's policy, when the API is a member
discovery 1

The gateway finds the PDP

The gateway first reads the resource's RFC 9728 document, then the PDP's AuthZEN metadata. It caches both documents. If the PDP publishes no metadata, it uses AuthZEN's default endpoint paths.

gateway the API the PDP GET /.well-known/oauth-protected-resource authzen_policy_set: [pdp, …] GET /.well-known/authzen-configuration access_evaluation_endpoint POST evaluation { context: resource_metadata, request, access_token } 12345
Orange identifies the discovered values. Steps 1 and 2 identify the PDP. Steps 3 and 4 identify its endpoint. Step 5 sends the API's requirements for evaluation.
what the API publishes · RFC 9728
{
  "resource": "https://api.bank-a.example",
  "authzen_policy_set": { "combining": "deny-overrides", "members": [
    "https://pdp.bank-a.example/tenants/bank-a"
  ] },
  "scopes_supported": ["accounts:read", "payments:write"],
  "acr_values_required": ["urn:idp:loa:mfa"]
}
what the PDP publishes · AuthZEN §9
{
  "policy_decision_point":
    "https://pdp.bank-a.example/tenants/bank-a",
  "access_evaluation_endpoint":
    "https://pdp.bank-a.example/tenants/bank-a/access/v1/evaluation",
  "access_evaluations_endpoint":
    "https://pdp.bank-a.example/tenants/bank-a/access/v1/evaluations"
}

AuthZEN metadata supplies the evaluation endpoint URLs. A PDP identifier can include a tenant path such as /tenants/bank-a. The authzen_policy_set field in resource metadata is a project extension. It is provisional pending a working-group profile.

discovery 2

The PDP evaluates the API's requirements

The gateway forwards the API's metadata as context.resource_metadata and identifies its source. It includes the request method and path. The route can also forward the raw access token. The PDP evaluates these inputs against policy.

what the gateway hands the PDP · AuthZEN context
"context": {
  "resource_metadata_source": "rfc9728",
  "resource_metadata": {
    "resource": "https://api.bank-a.example",
    "scopes_supported": ["accounts:read", "payments:write"],
    "acr_values_required": ["urn:idp:loa:mfa"],
    "authzen_policy_set": { … }
  },
  "request": { "method": "POST", "path": "/payments" },
  "access_token": "eyJ…"
}
what the PDP answers
{
  "decision": false,
  "context": {
    "reason": "this resource requires acr [urn:idp:loa:mfa]
      (per its rfc9728 metadata); the token was
      authenticated at urn:idp:loa:password"
  }
}

The PDP evaluates the API's access requirements. The gateway enforces the returned decision. In this example, the denial reason identifies the required authentication level and the metadata that supplied it.

Restrict the PDPs an API can use

An API can name a PDP that permits every request. TLS authenticates the host serving the metadata. OpenID Federation adds metadata policy from a verified trust chain. A trust anchor is a federation authority whose keys the operator configures as trusted.

SELF-ASSERTED FEDERATION the API gateway the API the anchor gateway its own document pdps: [rogue, bank-a] acr: [password] TLS authenticates the host serving this self-asserted metadata. the gateway uses the API's metadata the rogue decides onboarded entity configuration, signed by the API: pdps: [rogue, bank-a] acr: [password] the anchor's statement about it: pdps subset_of [bank-a] acr value [mfa] resolved metadata after policy pdps: [rogue, bank-a] acr: [password mfa]
The API publishes the same values in both examples. Resource discovery uses those values directly. Federation metadata policy removes the rogue PDP and requires multi-factor authentication (MFA). The gateway verifies the trust chain against the configured trust anchor.

Publish federation metadata through the gateway

The gateway can publish a signed entity configuration and RFC 9728 protected resource metadata for an API. The federation controller retrieves the entity configuration during enrolment. The gateway holds the signing key. The controller maintains metadata policy.

the gateway publishes · minimal
{
  "iss": "https://api.bank-a.example",
  "sub": "https://api.bank-a.example",
  "jwks": { "keys": [ … ] },
  "authority_hints": ["https://federation.example"],
  "metadata": { "oauth_resource": {
    "resource": "https://api.bank-a.example" } }
}
the controller maintains
"metadata": { "oauth_resource": {
  "authzen_policy_set": { "combining": "deny-overrides",
    "members": ["https://pdp.bank-a.example/tenants/bank-a"] },
  "scopes_supported": [ … ],
  "acr_values_required": ["urn:idp:loa:mfa"]
} },
"metadata_policy": { … }
the gateway republishes · RFC 9728
{
  "resource": "https://api.bank-a.example",
  "authzen_policy_set": { … },
  "scopes_supported": [ … ],
  "acr_values_required": ["urn:idp:loa:mfa"],
  "signed_metadata": "eyJ…"
}

The gateway resolves its trust chain and republishes the resulting metadata as a signed RFC 9728 document. Clients can read that document through resource discovery. Before federation enrolment, the document is self-asserted and names the configured PDP.

What discovery changes

Gateway integrations and the Node.js SDK

The Go service, coaz-pep, provides federation trust-chain resolution and the shared HTTP check API. Kong and PingAccess can perform resource and PDP discovery directly or delegate decisions to that service. The Node.js SDK provides enforcement within an application.

ComponentEnforces requests forFinds the PDPFederationMetadata publication
coaz-pep (Go)Envoy, Istio, agentgateway, and the MCP routes of Kong and PingAccessRFC 9728 and AuthZEN metadataresolves trust chains to configured anchorsholds the key, republishes the resolved document
Kong plugin (Lua)Kong routesRFC 9728 and AuthZEN metadata, in Luadelegated to coaz-peprelayed from coaz-pep
PingAccess rule (Java)PingAccess applications and resourcesRFC 9728 and AuthZEN metadata, in Javadelegated to coaz-peprelayed from coaz-pep
Node SDK (TypeScript)Express, and MCP servers in processRFC 9728 and AuthZEN metadatacustom resolver or delegation to coaz-pepsigns and serves its own, self-asserted

The integrations share evaluation context and challenge conventions. The configuration reference describes each component's discovery support and failure responses.

Compare discovery modes in the demo

The demo runs three instances of coaz-pep with different discovery modes. It includes a stub federation, PDPs for two banks, an estate PDP and a rogue one. The console shows the metadata each instance retrieves and the resulting decision.

Open the demo
  1. Select Discover. Each column shows the metadata retrieved and the evaluation sent to the PDP.
  2. Select member. Resource discovery uses the API's published requirements and the PDP permits the request. Federation discovery adds an MFA requirement through metadata policy and the PDP denies it.
  3. Select the gateway's own API and enrol it using the onboarding control. Select Discover again to see the resolved federation metadata.

The demo's components and controls are described in the demo reference. The architecture is described in docs/architecture.md.

Specifications