diff --git a/sources/cas_server.php b/sources/cas_server.php index e6ef560..226bf6f 100644 --- a/sources/cas_server.php +++ b/sources/cas_server.php @@ -1,15 +1,31 @@ @@ -29,11 +45,17 @@ switch ($url) { } break; + // First request from the client case $base_url . "/login": + // Generate a random number ticket which will be used by the client to authenticate to the server $ticket = bin2hex(random_bytes(50)); + + // Use the Ticket number as the session ID. + // This give the possiblity in the next request from the server to to find this session and the information related to. session_id($ticket); session_start(); + // If the user is authenticated by ssowat save the username and set it as cleanly authenticated if (array_key_exists('REMOTE_USER', $_SERVER) && strlen($_SERVER['REMOTE_USER']) > 0) { $_SESSION['user_authenticated'] = true; $_SESSION['user'] = $_SERVER['REMOTE_USER']; @@ -47,7 +69,6 @@ switch ($url) { break; case $base_url: - header('Status: 302 Moved Temporarily', false, 302); header('Location: ' . $_GET['redirectUrl']);