Skip to content
Snippets Groups Projects
Commit 7da29db3 authored by Mads Freek Petersen's avatar Mads Freek Petersen
Browse files

Updated the casserver module as per Dubravko Voncinas comments in

http://rnd.feide.no/content/simplesamlphp-cas-server-support.

cas.php is a frontend for login.php, validate.php and
serviceValidate.php. It allows them to be called as cas.php/login,
cas.php/validate and cas.php/serviceValidate and is meant for clients
like phpCAS which expects one configured prefix to which it appends
login, validate and serviceValidate.

The apache configurationchanges Dubravko Voncina mention is
thus not necessary any longer.



git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2227 44740490-163a-0410-bde0-09ae8108e29a
parent cf82853a
No related branches found
No related tags found
No related merge requests found
<?php
/*
* Frontend for login.php, validate.php and serviceValidate.php. It allows them to be called
* as cas.php/login, cas.php/validate and cas.php/serviceValidate and is meant for clients
* like phpCAS which expects one configured prefix which it appends login, validate and
* serviceValidate to.
*/
list($function) = preg_split('/[\/?]/', $_SERVER['PATH_INFO'], 0, PREG_SPLIT_NO_EMPTY);
include($function.".php");
\ No newline at end of file
...@@ -52,7 +52,7 @@ if (!$session->isValid($auth) ) { ...@@ -52,7 +52,7 @@ if (!$session->isValid($auth) ) {
$attributes = $session->getAttributes(); $attributes = $session->getAttributes();
$path = $casconfig->resolvePath($casconfig->getValue('ticketcache', 'ticketcache')); $path = $casconfig->resolvePath($casconfig->getValue('ticketcache', 'ticketcache'));
$ticket = SimpleSAML_Utilities::generateID(); $ticket = str_replace( '_', 'ST-', SimpleSAML_Utilities::generateID() );
storeTicket($ticket, $path, $attributes); storeTicket($ticket, $path, $attributes);
// $test = retrieveTicket($ticket, $path); // $test = retrieveTicket($ticket, $path);
......
...@@ -91,7 +91,7 @@ function storeTicket($ticket, $path, &$value ) { ...@@ -91,7 +91,7 @@ function storeTicket($ticket, $path, &$value ) {
function retrieveTicket($ticket, $path) { function retrieveTicket($ticket, $path) {
if (!preg_match('/^_?[a-zA-Z0-9]+$/D', $ticket)) throw new Exception('Invalid characters in ticket'); if (!preg_match('/^ST-?[a-zA-Z0-9]+$/D', $ticket)) throw new Exception('Invalid characters in ticket');
if (!is_dir($path)) if (!is_dir($path))
throw new Exception('Directory for CAS Server ticket storage [' . $path . '] does not exists. '); throw new Exception('Directory for CAS Server ticket storage [' . $path . '] does not exists. ');
......
...@@ -72,7 +72,8 @@ function storeTicket($ticket, $path, &$value ) { ...@@ -72,7 +72,8 @@ function storeTicket($ticket, $path, &$value ) {
function retrieveTicket($ticket, $path) { function retrieveTicket($ticket, $path) {
if (!preg_match('/^_?[a-zA-Z0-9]+$/D', $ticket)) throw new Exception('Invalid characters in ticket'); if (!preg_match('/^ST-?[a-zA-Z0-9]+$/D', $ticket)) throw new Exception('Invalid characters in ticket');
if (!is_dir($path)) if (!is_dir($path))
throw new Exception('Directory for CAS Server ticket storage [' . $path . '] does not exists. '); throw new Exception('Directory for CAS Server ticket storage [' . $path . '] does not exists. ');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment