Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
CodeIgniter CAS library
PHP
Branch: master
Failed to load latest commit information.
config
libraries
LICENCE.txt added license
README.md
spark.info updated version in spark.info

README.md

Code Igniter CAS Library

This CodeIgniter library wraps around phpCAS (the official CAS client from Jasig) to simplify use and configuration in a CodeIgniter app.

Installing manually

  1. Download phpCAS and put it in some accessible directory.

  2. Copy libraries/Cas.php into your CodeIgniter application's libraries folder

  3. Create a config file config/cas.php like this:

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$config['cas_server_url'] = 'https://yourserver.com/cas';
$config['phpcas_path'] = '/path/to/phpCAS-1.3.1';
$config['cas_disable_server_validation'] = TRUE;
// $config['cas_debug'] = TRUE; // <--  use this to enable phpCAS debug mode

That's it, now you can test in a controller, doing something like this:

function index() {
    $this->load->library('cas');
    $this->cas->force_auth();
    $user = $this->cas->user();
    echo "Hello, $user->userlogin!";
}

Installing using Sparks

If your project is using Sparks to manage dependencies, you can get the latest version of this library with these steps:

  1. Download phpCAS and put it in some accessible directory.
  2. Install the latest version of the library using Sparks: php tools/spark install cas-auth-library
  3. Create a config file config/cas.php like the example given for the manual installation.

Having done that, you should be able test it with this code:

public function index() {
    $this->load->spark('cas-auth-library/0.0.2'); // update this according to the version you installed
    $this->load->library('cas');
    $this->cas->force_auth();
    $user = $this->cas->user();
    echo "Welcome, $user->userlogin!";
}
Something went wrong with that request. Please try again.