Skip to content

Support forwarding selected ExternalAuth response headers to upstream backends #10525

Description

@alexandrunegoita-WI

Is your feature request related to a problem? Please describe.

The ExternalAuth Policy can allow or deny a request, but it does not currently provide a declarative way to forward selected headers returned by the authentication service to the upstream backend.

Our authentication service returns trusted identity headers such as:

  • Tenant-UUID
  • User-UUID
  • Permissions
  • Licenses
  • License-Constraints
  • X-Session-ID

With community ingress-nginx, this is supported through the nginx.ingress.kubernetes.io/auth-response-headers annotation. Without equivalent support, the backend receives the request but not the authenticated user and tenant context.

Describe the solution you'd like

Add an optional allowlist of authentication response headers to spec.externalAuth, for example:

spec:
  externalAuth:
    authURI: /v1/auth
    authServiceName: application/auth-service
    authServicePorts:
      - 80
    headersToBackend:
      - Tenant-UUID
      - User-UUID
      - Permissions
      - Licenses
      - License-Constraints
      - X-Session-ID

After a successful 2xx authentication response, the listed headers should be copied from the auth response to the request sent to the upstream backend.

Values returned by the trusted authentication service should replace any client-provided headers with the same names. Only explicitly configured headers should be forwarded.

The exact field name could also be responseHeaders or another name preferred by the maintainers.

Describe alternatives you've considered

Using snippets or a custom NGINX template, which introduces security, governance, and maintenance concerns.
Implementing authentication separately in every backend application.
Maintaining a private fork of the controller.
Switching to another ingress controller that supports forwarding authentication response headers.

Additional context

An attempted responseHeaders field is currently rejected because it is not part of the ExternalAuth CRD schema.

This capability is required for migration from community ingress-nginx, where the equivalent configuration is:

nginx.ingress.kubernetes.io/auth-url: http://auth-service.application.svc.cluster.local/v1/auth
nginx.ingress.kubernetes.io/auth-response-headers: Tenant-UUID, User-UUID, Permissions, Licenses, License-Constraints, X-Session-ID

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    communityIssues or PRs opened by an external contributorproposalAn issue that proposes a feature requestready for refinementAn issue that was triaged and it is ready to be refined

    Type

    No type

    Projects

    Status
    Prioritized backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions