Media broken after enabling SSO

CMS Version

4.1.1
Ubuntu 22.04, docker installation with apache proxy for https, SAML verification

Hello,
I have run to a problem, when using Xibo without SSO, everything works fine. When I enable SSO (using settings-custom.php), media cannot be loaded.

immediately after I enable SSO, media thumbnails gets broken, and all layouts becomes broken as well, because they cannot load images.Please see screenshots in attachements


When I disable SSO, and restart web container, immediately all media is fine, and layouts as well. And even all media which I uploaded when SSO was enables, is immediately visible as well. So uploading media works fine.
When I enable SSO again, and restart web container, media cannot be loaded.

I thought problem might be with permissions of /opt/xibo/shared/library directory, but seems that that’s not the case.
All media tested are simple jpg pictures and mp4 video.

When I try to open broken thumbnail, I can see this in log:


Strange is record ID mentioning width + height 0 x 0. But in Library, media is listed with correct dimensions.

Problem seems similar, but not the same as in this thread: V4 layout preview not showing - #3 by Robert_Simpson

Any help would be greatly appreciated.
Petr