#15083·onyx

SAML login fails after upgrade to v4.8.0: 'received at http instead of https'

Author: aizerinCreated Sep 24, 2026Updated Sep 25, 2026

Bug Description

After upgrading from v4.5.2 to v4.8.0, SAML authentication fails with:

Access denied. Failed to parse SAML response.
SAML errors: invalid_response The response was received at http://xxx.cz:3000/auth/saml/callback instead of https://xxx.cz:3000/auth/saml/callback

Root Cause

In backend/onyx/server/saml.py, the prepare_from_fastapi_request() function builds the request_data dict for OneLogin SAML library but does not set the https key. The OneLogin library's is_https() function checks this key to determine the protocol:

python
@staticmethod
def is_https(request_data):
    is_https = 'https' in request_data and request_data['https'] != 'off'
    is_https = is_https or ('server_port' in request_data and str(request_data['server_port']) == '443')
    return is_https

Since https is missing and server_port is 3000 (not 443), the library defaults to HTTP, causing the URL mismatch error.

Fix

Add https key to the request data dict:

python
rv: dict[str, Any] = {
    "http_host": http_host,
    "server_port": server_port,
    "script_name": request.url.path,
    "https": "on" if parsed_domain.scheme == "https" else "off",  # <-- ADD THIS
    "post_data": {},
    "get_data": {},
}

Environment

  • Onyx version: v4.8.0
  • Deployment: Docker Compose with nginx reverse proxy
  • WEB_DOMAIN=https://xxx.cz:3000
  • AUTH_TYPE=basic (SAML configured via admin panel)

Workaround

Patch the file in the running container and restart api_server. This is lost on image pull.