Skip to content

Commit

Permalink
support for CAS fixedServiceURL
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien Ducoulombier committed Dec 30, 2019
1 parent 7006457 commit c1f31a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/config/auth.conf.dist.php
Expand Up @@ -120,4 +120,6 @@
// 'verbose' => false,
// 'debug' => '/var/log/cas_debug.log',
'noCasServerValidation' => true, // set to false in production
// 'fixedServiceURL' => false, // false by default, set to either true or to the service URL string if needed
// sites might also need proxy_settings in configuration.php
];
15 changes: 11 additions & 4 deletions main/auth/cas/cas_var.inc.php
Expand Up @@ -47,16 +47,23 @@
phpCAS::setNoCasServerValidation();
}

global $_configuration;
if (is_array($_configuration)
&& array_key_exists('proxy_settings', $_configuration)) {
$proxySettings = $_configuration['proxy_settings'];
$proxySettings = api_get_configuration_value('proxy_settings');
if (false !== $proxySettings) {
if (is_array($proxySettings) && array_key_exists('https', $proxySettings)) {
$https = $proxySettings['https'];
if (is_string($https) && !empty($https)) {
phpCAS::setExtraCurlOption(CURLOPT_PROXY, $https);
}
}
}

if (is_array($cas) && array_key_exists('fixedServiceURL', $cas)) {
$fixedServiceURL = $cas['fixedServiceURL'];
if (is_string($fixedServiceURL)) {
phpCAS::setFixedServiceURL($fixedServiceURL);
} else if (is_bool($fixedServiceURL) && $fixedServiceURL) {
phpCAS::setFixedServiceURL(api_get_configuration_value('root_web'));
}
}
}
}

0 comments on commit c1f31a7

Please sign in to comment.