4 * The purpose of this central config file is configuring all examples
5 * in one place with minimal work for your working environment
6 * Just configure all the items in this config according to your environment
7 * and rename the file to config.php
12 * @category Authentication
14 * @author Joachim Fritschi <jfritschi@freenet.de>
15 * @author Adam Franco <afranco@middlebury.edu>
16 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
17 * @link https://wiki.jasig.org/display/CASC/phpCAS
20 $phpcas_path = '../../source/';
22 ///////////////////////////////////////
23 // Basic Config of the phpCAS client //
24 ///////////////////////////////////////
26 // Full Hostname of your CAS Server
27 $cas_host = 'cas.example.com';
29 // Context of the CAS Server
30 $cas_context = '/cas';
32 // Port of your CAS server. Normally for a https server it's 443
35 // Path to the ca chain that issued the cas server certificate
36 $cas_server_ca_cert_path = '/path/to/cachain.pem';
38 //////////////////////////////////////////
39 // Advanced Config for special purposes //
40 //////////////////////////////////////////
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');
46 // Database config for PGT Storage
47 $db = 'pgsql:host=localhost;dbname=phpcas';
48 //$db = 'mysql:host=localhost;dbname=phpcas';
49 $db_user = 'phpcasuser';
50 $db_password = 'mysupersecretpass';
51 $db_table = 'phpcastabel';
54 ///////////////////////////////////////////
55 // End Configuration -- Don't edit below //
56 ///////////////////////////////////////////
58 // Generating the URLS for the local cas example services for proxy testing
59 if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
60 $curbase = 'https://' . $_SERVER['SERVER_NAME'];
62 $curbase = 'http://' . $_SERVER['SERVER_NAME'];
64 if ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) {
65 $curbase .= ':' . $_SERVER['SERVER_PORT'];
68 $curdir = dirname($_SERVER['REQUEST_URI']) . "/";
70 // CAS client nodes for rebroadcasting pgtIou/pgtId and logoutRequest
71 $rebroadcast_node_1 = 'http://cas-client-1.example.com';
72 $rebroadcast_node_2 = 'http://cas-client-2.example.com';
74 // access to a single service
75 $serviceUrl = $curbase . $curdir . 'example_service.php';
76 // access to a second service
77 $serviceUrl2 = $curbase . $curdir . 'example_service_that_proxies.php';
79 $pgtBase = preg_quote(preg_replace('/^http:/', 'https:', $curbase . $curdir), '/');
80 $pgtUrlRegexp = '/^' . $pgtBase . '.*$/';
82 $cas_url = 'https://' . $cas_host;
83 if ($cas_port != '443') {
84 $cas_url = $cas_url . ':' . $cas_port;
86 $cas_url = $cas_url . $cas_context;
88 // Set the session-name to be unique to the current script so that the client script
89 // doesn't share its session with a proxied script.
90 // This is just useful when running the example code, but not normally.
93 . preg_replace('/[^a-z0-9-]/i', '_', basename($_SERVER['SCRIPT_NAME']))
95 // Set an UTF-8 encoding header for internation characters (User attributes)
96 header('Content-Type: text/html; charset=utf-8');