Reputation: 2705
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)
Upvotes: 0
Views: 683
Reputation: 12721
You need a CAS Server running at www.domain.com/accounts it will provide the login form.
http://www.jasig.org/cas/download
Upvotes: 1