Skip to content

Conversation

@EricWittmann
Copy link
Member

Summary

  • Implements proxy header authentication mechanism for delegating authentication to a trusted reverse proxy
  • Adds support for extracting user identity from HTTP headers set by the proxy
  • Integrates seamlessly with existing OIDC and Basic authentication mechanisms
  • Includes optional trust mode to bypass local authorization when proxy handles it

Implementation Details

  • ProxyHeaderAuthenticationMechanism: Core authentication mechanism that extracts credentials from HTTP headers
  • ProxyHeaderIdentityProvider: Validates credentials and creates security identity with user principal and roles
  • ProxyHeaderCredential: Credential type for proxy-authenticated requests
  • AuthConfig: Extended with configuration properties for proxy header authentication
  • AppAuthenticationMechanism: Updated to integrate proxy header auth in the authentication pipeline
  • AuthorizedInterceptor: Enhanced to support proxy authorization trust mode

Configuration

New configuration properties added:

  • apicurio.authn.proxy-header.enabled: Enable/disable proxy header authentication (default: false)
  • apicurio.authn.proxy-header.username: HTTP header name for username (default: X-Forwarded-User)
  • apicurio.authn.proxy-header.email: HTTP header name for email (default: X-Forwarded-Email)
  • apicurio.authn.proxy-header.groups: HTTP header name for groups/roles (default: X-Forwarded-Groups)
  • apicurio.authn.proxy-header.trust-proxy-authorization: Trust proxy for authorization (default: false)

Test Coverage

  • ProxyHeaderAuthTest: Tests standard proxy header authentication flow
  • ProxyHeaderTrustAuthTest: Tests proxy authorization trust mode
  • Test profiles included for both authentication modes

Documentation

  • Updated configuration reference documentation with new properties
  • Changed quarkus.http.auth.proactive to true for proper authentication flow

Implements a new authentication mechanism that delegates authentication to a trusted proxy.
The proxy passes user identity information via HTTP headers (username, email, groups).

Key features:
- Configurable header names for username, email, and groups/roles
- Optional trust mode that bypasses local authorization when proxy is trusted
- Integration with existing authentication pipeline alongside OIDC and Basic auth
- Comprehensive test coverage including both standard and trust modes

Configuration properties:
- apicurio.authn.proxy-header.enabled: Enable/disable the mechanism
- apicurio.authn.proxy-header.username: Header name for username (default: X-Forwarded-User)
- apicurio.authn.proxy-header.email: Header name for email (default: X-Forwarded-Email)
- apicurio.authn.proxy-header.groups: Header name for groups (default: X-Forwarded-Groups)
- apicurio.authn.proxy-header.trust-proxy-authorization: Trust proxy for authorization
The change to quarkus.http.auth.proactive=true caused authentication
to execute on the Vert.x event loop thread. This broke existing OIDC
basic credentials authentication which makes blocking HTTP calls to
the token endpoint, resulting in 'Must not be called on event loop'
exceptions.

Reverting to proactive=false ensures authentication happens on worker
threads where blocking operations are allowed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants