Describe the bug
When using AUTH_TYPE=OAUTH2PROXY, server-side rendered (SSR) components make internal requests to the Keep backend via createServerApiClient().
Currently, createServerApiClient() forwards only identity headers (x-forwarded-user, x-forwarded-email, x-forwarded-groups, x-forwarded-access-token). In deployments where reverse proxies or sidecars independently authenticate inbound backend requests with session validation, internal server-to-server calls fail with 401 Unauthorized / 302 Redirect because the session cookie header is dropped.
This causes SSR pages like /incidents and /alerts/feed (which preload initial facets using Server Components) to fail during server rendering.
To Reproduce
Steps to reproduce the behavior:
- Configure the app with
AUTH_TYPE=OAUTH2PROXY.
- Load an SSR page that triggers backend calls, such as
/incidents or /alerts/feed.
- Use a deployment where backend authentication relies on the request cookie at a reverse proxy or sidecar layer.
- Observe that the internal request loses the
cookie header and returns 401 Unauthorized or 302 Redirect.
Expected behavior
createServerApiClient() should forward the incoming request's cookie header when AUTH_TYPE === AuthType.OAUTH2PROXY, alongside the existing OAuth2-proxy identity headers.
Screenshots
Additional context
- The current implementation also contains leftover debug
console.log statements that should be removed as part of the fix.
- Unit tests should cover both identity header forwarding and cookie forwarding behavior.
- SSR pages such as
/incidents and /alerts/feed should render successfully in reverse-proxy-authenticated deployments.
Describe the bug
When using
AUTH_TYPE=OAUTH2PROXY, server-side rendered (SSR) components make internal requests to the Keep backend viacreateServerApiClient().Currently,
createServerApiClient()forwards only identity headers (x-forwarded-user,x-forwarded-email,x-forwarded-groups,x-forwarded-access-token). In deployments where reverse proxies or sidecars independently authenticate inbound backend requests with session validation, internal server-to-server calls fail with401 Unauthorized/302 Redirectbecause the sessioncookieheader is dropped.This causes SSR pages like
/incidentsand/alerts/feed(which preload initial facets using Server Components) to fail during server rendering.To Reproduce
Steps to reproduce the behavior:
AUTH_TYPE=OAUTH2PROXY./incidentsor/alerts/feed.cookieheader and returns401 Unauthorizedor302 Redirect.Expected behavior
createServerApiClient()should forward the incoming request'scookieheader whenAUTH_TYPE === AuthType.OAUTH2PROXY, alongside the existing OAuth2-proxy identity headers.Screenshots
Additional context
console.logstatements that should be removed as part of the fix./incidentsand/alerts/feedshould render successfully in reverse-proxy-authenticated deployments.