phpCAS version 1.3.6

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';
49 $client_secure = true;
50 $client_httpOnly = true;
51 $client_lifetime = 0;
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';
59 $driver_options = '';
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 }
93 $cas_url = $cas_url . $cas_context;
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_domain
Definition: config.example.php:47
$client_path
$client_path
Definition: config.example.php:48
$pgtUrlRegexp
$pgtUrlRegexp
Definition: config.example.php:87
$cas_url
$cas_url
Definition: config.example.php:89
$serviceUrl2
$serviceUrl2
Definition: config.example.php:84
$client_httpOnly
$client_httpOnly
Definition: config.example.php:50
$cas_server_ca_cert_path
$cas_server_ca_cert_path
Definition: config.example.php:36
$cas_real_hosts
$cas_real_hosts
Definition: config.example.php:44
$client_secure
$client_secure
Definition: config.example.php:49
$db_table
$db_table
Definition: config.example.php:58
$phpcas_path
$phpcas_path
Definition: config.example.php:20
$rebroadcast_node_2
$rebroadcast_node_2
Definition: config.example.php:79
$pgtBase
$pgtBase
Definition: config.example.php:86
$db
$db
Definition: config.example.php:54
$driver_options
$driver_options
Definition: config.example.php:59
$client_lifetime
$client_lifetime
Definition: config.example.php:51
$db_password
$db_password
Definition: config.example.php:57
$db_user
$db_user
Definition: config.example.php:56
$cas_host
$cas_host
Definition: config.example.php:27
$cas_context
$cas_context
Definition: config.example.php:30
$serviceUrl
$serviceUrl
Definition: config.example.php:82
$curdir
if($_SERVER['SERVER_PORT'] !=80 && $_SERVER['SERVER_PORT'] !=443) $curdir
Definition: config.example.php:75
$cas_port
$cas_port
Definition: config.example.php:33
$rebroadcast_node_1
$rebroadcast_node_1
Definition: config.example.php:78