4 # set manually if called directly - ie not included from validate.php or cas.php 15 if (array_key_exists(
'service',
$_GET)) {
17 $ticket =
$_GET[
'ticket'];
20 throw new Exception(
'Required URL query parameter [service] not provided. (CAS Server)');
42 if (isset(
$_GET[
'pgtUrl'])) {
43 $pgtUrl =
$_GET[
'pgtUrl'];
44 $pgtiou = str_replace(
'_',
'PGTIOU-',
SimpleSAML\Utils\Random::generateID());
45 $pgt = str_replace(
'_',
'PGT-',
SimpleSAML\Utils\Random::generateID());
48 'forceAuthn' =>
false,
50 'validbefore' =>
time() + 60);
53 $pgtiouxml =
"\n<cas:proxyGrantingTicket>$pgtiou</cas:proxyGrantingTicket>\n";
56 $proxiesxml = join(
"\n", array_map(create_function(
'$a',
'return "<cas:proxy>$a</cas:proxy>";'),
$ticketcontent[
'proxies']));
57 if ($proxiesxml) $proxiesxml =
"<cas:proxies>\n$proxiesxml\n</cas:proxies>\n";
68 if ($value ===
'YES') {
71 foreach (
$attributes as $attributename => $attributelist) {
72 $attr = htmlspecialchars($attributename);
73 foreach ($attributelist as $attributevalue) {
74 $attributesxml .=
"<cas:$attr>" . htmlspecialchars($attributevalue) .
"</cas:$attr>\n";
77 if (
sizeof(
$attributes)) $attributesxml =
"<cas:attributes>\n" . $attributesxml .
"</cas:attributes>\n";
78 echo
'<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas"> 79 <cas:authenticationSuccess> 80 <cas:user>' . htmlspecialchars($usrname) .
'</cas:user>' .
83 '</cas:authenticationSuccess> 84 </cas:serviceResponse>';
86 echo
'yes' .
"\n" . $usrname;
90 echo
'<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas"> 91 <cas:authenticationFailure code=""> 92 </cas:authenticationFailure> 93 </cas:serviceResponse>';
catch(Exception $e) returnResponse($value, $function, $usrname='', $attributes=array(), $xtraxml="")
retrieveTicket($ticket, $path, $unlink=true)
Attribute-related utility methods.
static getConfig($filename='config.php', $configSet='simplesaml')
Load a configuration file from a configuration set.
static fetch($url, $context=array(), $getHeaders=false)
Helper function to retrieve a file or URL with proxy support, also supporting proxy basic authorizati...
Create styles array
The data for the language used.
storeTicket($ticket, $path, $value)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.