You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are considering extending oidc-gateway from an OIDC-only Envoy jwt_authn + ext_authz gateway into a unified authentication gateway that can authorize requests using three credential types:
OIDC bearer tokens
SPIFFE JWT-SVID bearer tokens
SPIFFE X.509-SVID client certificates
Why
The goal is to move authorization decisions out of downstream services and into oidc-gateway, while still supporting both human/user auth and workload identities.
In our case, the backend should receive a normalized identity contract regardless of how the caller authenticated.
Proposed auth precedence
For non-public paths:
If a valid SPIFFE X.509-SVID is present, use it.
If X.509-SVID is present, ignore any bearer token on the request.
If no X.509 identity is present, try bearer auth.
Bearer auth may succeed via either:
OIDC JWT
SPIFFE JWT-SVID
Otherwise deny.
For public paths:
allow without credentials
Proposed backend contract
Instead of forwarding mechanism-specific headers, forward a single canonical header to the backend:
For OIDC issuers, add an explicit stable providerKey to configuration and use that key, not the raw issuer URL, in canonical principals and authz rules. For example:
This package would be intentionally dependency-light and reusable by authzserver, dir, or other consumers, but it would not import Envoy, Casbin, or gateway-specific logic.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We are considering extending
oidc-gatewayfrom an OIDC-only Envoyjwt_authn+ext_authzgateway into a unified authentication gateway that can authorize requests using three credential types:Why
The goal is to move authorization decisions out of downstream services and into
oidc-gateway, while still supporting both human/user auth and workload identities.In our case, the backend should receive a normalized identity contract regardless of how the caller authenticated.
Proposed auth precedence
For non-public paths:
For public paths:
Proposed backend contract
Instead of forwarding mechanism-specific headers, forward a single canonical header to the backend:
x-auth-principalThe value format would be:
<auth-family>:<canonical-principal>Examples:
spiffe:spiffe://example.org/ns/default/sa/backendoidc:dex:aliceoidc:dex:sync-serviceoidc:github:repo:org/repo:workflow:deploy.yml:ref:refs/heads/mainThis avoids sending redundant or auth-mechanism-specific headers like
x-jwt-principal,x-user-id,x-auth-type, etc.Proposed principal normalization
Canonical principal grammar:
spiffe:<spiffe-id>spiffe:<spiffe-id>oidc:<providerKey>:<principal>Examples:
spiffe:spiffe://example.org/ns/default/sa/backendoidc:dex:aliceoidc:dex:sync-serviceoidc:github:repo:org/repo:workflow:deploy.yml:ref:refs/heads/mainFor OIDC issuers, add an explicit stable
providerKeyto configuration and use that key, not the raw issuer URL, in canonical principals and authz rules. For example:This keeps principal strings and policy patterns readable and stable:
oidc:dex:*oidc:github:*Shared identity package
We are also considering adding a lightweight standalone package in this repo:
github.com/agntcy/oidc-gateway/identityidentityThis package would be intentionally dependency-light and reusable by
authzserver,dir, or other consumers, but it would not import Envoy, Casbin, or gateway-specific logic.A possible initial API shape:
Envoy / ext-authz shape
Conceptually this would mean:
jwt_authnhandles OIDC and JWT-SVID bearer validation as fallbackext_authzperforms authorization over a normalized principal modelx-auth-principalheader from the gatewayAuthorization rules
We are also considering a rule model shaped roughly like:
That suggests subject matching should operate on canonical principal strings rather than a JWT-specific role mapping model.
Open design question
Would maintainers prefer this to be modeled as:
Interested in feedback on:
oidc-gatewayX.509-SVIDwins and bearer is ignored)identitypackage in this repoext_authz, or bothAll reactions