Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

SAML endpoints prob...
 
Notifications
Clear all

SAML endpoints problem when projeqtor located behind a reverse proxy

3 Posts
2 Users
0 Reactions
1,599 Views
(@vanrar68)
Posts: 5
Active Member
Topic starter
 
[#7970]

When SAML authentication is enabled Projeqtor tries to automaticaly generate the SAML SP entityid and SAML endpoints URL based on values from the $_SERVER array (getBaseUrl() in model/persitence/SqlElement.php)
Currently this function doesn't check standard variables set by common reverse proxy (eg. X_FORWARDED_PROTO). When the reverse proxy is doing SSL termination (HTTPS between the browser and the reverse proxy, HTTP between the reverse proxy and the Projeqtor server). This is often the case for cloud/kubernetes deployment.
Projeqtor generates SAML endpoints URL with http prefix instead of https prefix. This behaviour generates browser warnings because of the security context switch.

The following solves the problem (in getBaseUrl() in model/persitence/SqlElement.php):
$https=(isset($_SERVER['HTTPS']) || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https'))?'on':'off';

Maybe a configuration setting is better suited

Regards


 
Posted : 14 Dec 2021 23H31
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Hi,

Thnaks for pointing out the issue.
Your proposale is weird and won't work on our Dev environments.
We added possibility to define parameter

if (Parameter::getGlobalParameter('paramHttps')!='') $https=Parameter::getGlobalParameter('paramHttps');

So you just have to add in your parameters.php file

$paramHttps='on';

​​​​​​​Fix will be deployed on V9.4.0


 
Posted : 16 Dec 2021 13H35
(@vanrar68)
Posts: 5
Active Member
Topic starter
 

Works great on 9.4.2, thanks


 
Posted : 19 Jan 2022 22H51
Share:

Scroll to Top