0

I am trying to use CAS as my Single Sign On service and I am really having a hard time understanding the basics. This is how I issue my requests:

start page: index.php:

<?php

include_once('../accounts/cas/config.php');
include_once('../accounts/cas/CAS.php');
phpCAS::setDebug();
phpCAS::client(CAS_VERSION_2_0, 'www.domain.com', 443, '/accounts');
phpCAS::setNoCasServerValidation();
phpCAS::forceAuthentication();

if (isset($_REQUEST['logout'])) {
    phpCAS::logout();
}

if (phpCAS::isAuthenticated()) {
    $name = phpCAS::getUser();
}

?>

When I point my browser to this page, it redirects to this URL: https://www.domain.com/accounts/login?service=https://www.domain.com

I created a file accounts/login/index.php for this request and I don't know what code must be in there. Do I have to write an html form to log the user in? Or does CAS do this for me?

My problem is that I am really missing the basics and I could not find any documentation I could understad. My file structure is like this:

/my_app (accessible via: https://www.domain.com)
    /index.php
/accounts
    /cas
        /config.php
        /CAS.php
    /login
        /index.php
    /certificate
        /domain.crt

Any light on this will highly appreciated (even a tutorial / example I can follow)

Sthe
  • 2,575
  • 2
  • 31
  • 48

1 Answers1

1

You need a CAS Server running at www.domain.com/accounts it will provide the login form.

http://www.jasig.org/cas/download

Andreas Linden
  • 12,489
  • 7
  • 51
  • 67
  • Thanks. I didn't even know there was a difference between CAS server and phpCAS library. Last question: is CAS only available in JSP (JAVA)? Isn't there a PHP alternative to it? Please help out if you know any. I've never used this before. – Sthe Apr 15 '12 at 10:25
  • I think the CAS server is Java only – Andreas Linden Apr 15 '12 at 10:31