Skip to content

Commit

Permalink
Merge pull request #1578 from kheimon/fix-cas-client-1.6.x
Browse files Browse the repository at this point in the history
fix(cas-sso): pass CAS_BASEURL as 5th arg for phpCAS 1.6.0 and newer
  • Loading branch information
Lea9250 authored Dec 18, 2023
2 parents 616ea3e + c4c64c2 commit fd7926c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions backend/AUTH/methode/cas.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,19 @@ function get_cas_config() {

$config = get_cas_config();
$cas = new phpCas();

// Enable debugging
$cas->setLogger();

// Enable verbose error messages. Disable in production
$cas->setVerbose(true);

if (!isset($sql_update)) {
$cas->client(CAS_VERSION_2_0, $config['CAS_HOST'], (int)$config['CAS_PORT'], $config['CAS_URI']);
// Set Service URL
// required if operating behind a load balancer or reverse proxy.
// phpCAS 1.6.0 and newer require passing $client_service_name as 5th arg - implemented here as CAS_BASEURL.
$cas->client(CAS_VERSION_2_0, $config['CAS_HOST'], (int)$config['CAS_PORT'], $config['CAS_URI'], $config['CAS_BASEURL']);

// Set Service URL - required if operating behind a load balancer or reverse proxy.
// Note: might not be required for phpCAS 1.6.0 and newer
if (!isset($config['CAS_BASEURL'])) {
$cas->setFixedServiceURL($config['CAS_BASEURL']);
}
Expand Down

0 comments on commit fd7926c

Please sign in to comment.