Skip to content


Subversion checkout URL

You can clone with
Download ZIP
PHP5 CAS Authentication library
Branch: master

Merge pull request #12 from mfairchild365/mfairchild365-patch-1

`$_SERVER['SERVER_NAME']` will not always be set
latest commit 53fc488295
@saltybeagle authored
Failed to load latest commit information.
docs/examples Use stash as the caching library
src `$_SERVER['SERVER_NAME']` will not always be set
vendor Forget you PEAR_Exception\!
API-0.6.0 Add release notes for 0.6.0 Update install information
RELEASE-0.6.0 Add release notes for 0.6.0
composer.json Include phpstash and fix reference to HTTP_Request2
package.xml Prep for 0.6.0 release
package_compatible.xml Prep for 0.6.0 release

SimpleCAS PHP 5 CAS Client

This is a PHP 5 client library for JA-SIG Central Authentication Service (CAS).

Compatible with servers using version 1 or 2 of the CAS protocol.

Install with Composer

A sample composer.json for your project that might requires SimpleCAS might look like:

    "repositories": [
            "type": "vcs",
            "url": ""
            "type": "pear",
            "url": ""
    "require": {
        "pear-pear/HTTP_Request2": "*",
        "SimpleCAS/SimpleCAS": "dev-master"

Manual install

Manually install by downloading the latest release and extracting the files, along with HTTP_Request2 from PEAR.

Quick Example:


require_once 'SimpleCAS/Autoload.php';
require_once 'HTTP/Request2.php';

$options = array('hostname' => '',
                 'port'     => 443,
                 'uri'      => 'cas');
$protocol = new SimpleCAS_Protocol_Version2($options);

$client = SimpleCAS::client($protocol);

if (isset($_GET['logout'])) {

if ($client->isAuthenticated()) {
    echo '<h1>Authentication Successful!</h1>
          <p>The user\'s login is '.$client->getUsername().'</p>
          <a href="?logout">Logout</a>';
Something went wrong with that request. Please try again.