Revision: 2227
Author: [email protected]
Date: Sat Mar 20 05:17:16 2010
Log: 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.
http://code.google.com/p/simplesamlphp/source/detail?r=2227
Added:
/trunk/modules/casserver/www/cas.php
Modified:
/trunk/modules/casserver/www/login.php
/trunk/modules/casserver/www/serviceValidate.php
/trunk/modules/casserver/www/validate.php
=======================================
--- /dev/null
+++ /trunk/modules/casserver/www/cas.php Sat Mar 20 05:17:16 2010
@@ -0,0 +1,13 @@
+<?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");
=======================================
--- /trunk/modules/casserver/www/login.php Wed Feb 25 23:19:00 2009
+++ /trunk/modules/casserver/www/login.php Sat Mar 20 05:17:16 2010
@@ -52,7 +52,7 @@
$attributes = $session->getAttributes();
$path =
$casconfig->resolvePath($casconfig->getValue('ticketcache', 'ticketcache'));
-$ticket = SimpleSAML_Utilities::generateID();
+$ticket = str_replace( '_', 'ST-', SimpleSAML_Utilities::generateID() );
storeTicket($ticket, $path, $attributes);
// $test = retrieveTicket($ticket, $path);
=======================================
--- /trunk/modules/casserver/www/serviceValidate.php Tue Feb 16 04:21:51
2010
+++ /trunk/modules/casserver/www/serviceValidate.php Sat Mar 20 05:17:16
2010
@@ -91,7 +91,7 @@
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))
throw new Exception('Directory for CAS Server ticket storage [' .
$path . '] does not exists. ');
=======================================
--- /trunk/modules/casserver/www/validate.php Tue Feb 16 04:21:51 2010
+++ /trunk/modules/casserver/www/validate.php Sat Mar 20 05:17:16 2010
@@ -72,7 +72,8 @@
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))
throw new Exception('Directory for CAS Server ticket storage [' .
$path . '] does not exists. ');
--
You received this message because you are subscribed to the Google Groups
"simpleSAMLphp commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/simplesamlphp-commits?hl=en.