This example PHP page, index.php
, requires authentication from the CAS server defined in config.php
before rendering any output.
-
Clone this repo to a location that is web accessible, on a web server with PHP enabled.
-
Copy
config.sample.php
toconfig.php
and set the appropriate values for your CAS server. -
Visit the page in a browser, authenticate via CAS, and you will see Welcome, <username> on the page. If not, check your web server error logs for details.
-
phpCAS has been added via
composer require apereo/phpcas
and included via the composer autoloader. -
More phpCAS examples are available from Apereo here:
-
CA certificate bundle copied from WordPress core:
https://github.com/WordPress/WordPress/blob/master/wp-includes/certificates/ca-bundle.crt