phpCAS  version 1.4.0
config.example.php
Go to the documentation of this file.
1 <?php
2 
20 $phpcas_path = '../../source/';
21 
23 // Basic Config of the phpCAS client //
25 
26 // Full Hostname of your CAS Server
27 $cas_host = 'cas.example.com';
28 
29 // Context of the CAS Server
30 $cas_context = '/cas';
31 
32 // Port of your CAS server. Normally for a https server it's 443
33 $cas_port = 443;
34 
35 // Path to the ca chain that issued the cas server certificate
36 $cas_server_ca_cert_path = '/path/to/cachain.pem';
37 
39 // Advanced Config for special purposes //
41 
42 // The "real" hosts of clustered cas server that send SAML logout messages
43 // Assumes the cas server is load balanced across multiple hosts
44 $cas_real_hosts = array('cas-real-1.example.com', 'cas-real-2.example.com');
45 
46 // Client config for cookie hardening
47 $client_domain = '127.0.0.1';
48 $client_path = 'phpcas';
52 
53 // Database config for PGT Storage
54 $db = 'pgsql:host=localhost;dbname=phpcas';
55 //$db = 'mysql:host=localhost;dbname=phpcas';
56 $db_user = 'phpcasuser';
57 $db_password = 'mysupersecretpass';
58 $db_table = 'phpcastabel';
60 
62 // End Configuration -- Don't edit below //
64 
65 // Generating the URLS for the local cas example services for proxy testing
66 if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
67  $curbase = 'https://' . $_SERVER['SERVER_NAME'];
68 } else {
69  $curbase = 'http://' . $_SERVER['SERVER_NAME'];
70 }
71 if ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) {
72  $curbase .= ':' . $_SERVER['SERVER_PORT'];
73 }
74 
75 $curdir = dirname($_SERVER['REQUEST_URI']) . "/";
76 
77 // CAS client nodes for rebroadcasting pgtIou/pgtId and logoutRequest
78 $rebroadcast_node_1 = 'http://cas-client-1.example.com';
79 $rebroadcast_node_2 = 'http://cas-client-2.example.com';
80 
81 // access to a single service
82 $serviceUrl = $curbase . $curdir . 'example_service.php';
83 // access to a second service
84 $serviceUrl2 = $curbase . $curdir . 'example_service_that_proxies.php';
85 
86 $pgtBase = preg_quote(preg_replace('/^http:/', 'https:', $curbase . $curdir), '/');
87 $pgtUrlRegexp = '/^' . $pgtBase . '.*$/';
88 
89 $cas_url = 'https://' . $cas_host;
90 if ($cas_port != '443') {
91  $cas_url = $cas_url . ':' . $cas_port;
92 }
94 
95 // Set the session-name to be unique to the current script so that the client script
96 // doesn't share its session with a proxied script.
97 // This is just useful when running the example code, but not normally.
98 session_name(
99  'session_for-'
100  . preg_replace('/[^a-z0-9-]/i', '_', basename($_SERVER['SCRIPT_NAME']))
101 );
102 // Set an UTF-8 encoding header for internation characters (User attributes)
103 header('Content-Type: text/html; charset=utf-8');
104 ?>
$client_domain
$client_path
$pgtUrlRegexp
$cas_url
$serviceUrl2
$client_httpOnly
$cas_server_ca_cert_path
$cas_real_hosts
$client_secure
$db_table
$phpcas_path
$rebroadcast_node_2
$pgtBase
$driver_options
$client_lifetime
$db_password
$db_user
$cas_host
$cas_context
$serviceUrl
if($_SERVER['SERVER_PORT'] !=80 && $_SERVER['SERVER_PORT'] !=443) $curdir
$cas_port
$rebroadcast_node_1