Central Authentication Service (CAS)

From Web Developer Network Wiki
Jump to: navigation, search

Web applications can utilize UNL's Central Authentication Service (CAS) by integrating this single sign-on solution [1].

CAS is a project maintained by JASIG read more at the CAS website.

Currently there are many libraries for integrating CAS authentication into web applications.

Any of the available libraries should work, the only one readily available is a PHP library. The PHP library is available in the UNL WDN Coding Group's CVS repository - under the UNL_Auth module.

Install the PHP library with pear channel-discover pear.unl.edu && pear install --alldeps unl/UNL_Auth-beta

<?php
require_once 'UNL/Auth.php';

$auth = UNL_Auth::factory('CAS');

if (isset($_GET['login'])) {
	$auth->login();
} elseif (isset($_GET['logout'])) {
	$auth->logout();
}

$self = htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES);

if (!$auth->isLoggedIn()) {
    // Could call $auth->login() here to get the party started.
	echo "You are not logged in.\n<br />\n";
	echo "<a href='$self?login=true'>Click here to log in!</a>";
} else {
	echo "You are logged in as {$auth->getUser()}<br />\n";
	echo "<a href='$self?logout'>logout</a>";
}

Contact Brett Bieber or Ryan Lim for more information regarding the PHP library.


For information regarding the server, contact John Thiltges.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox