Brian,
I found that I need *both* the call to handleLogoutRequest() AND a check for 
"logout" in the Request.

So ultimately I have the following specifically for handling single sign out:

//connect to CAS
...
//setup handleLogoutRequests
phpCAS::handleLogoutRequests(true, array( "localhost" ) );

//check for logout request
if (isset($_REQUEST['logout'])) {
   $backurl = $CFG->wwwroot;
    phpCAS::logoutWithUrl($backurl);
}

//if not a logout request, check authentication
if (phpCAS::checkAuthentication()) {
...


If you haven't used it already, I found that the phpCAS::setDebug is REALLY 
useful.

Put the following:
    phpCAS::setDebug("C:/temp/phpCAS.log");

Before you call phpCAS::proxy or phpCAS::client

Then if you're on linux (or windows using UnixUtils), you can tail the logfile  
( C:\temp>tail -f phpCAS.log )   and the tail will show you exactly what's 
being written to the logfile.

My only outstanding issue with this is it seems to log me out of CAS perfectly, 
but my local application (Moodle) session is still alive, so I think I need to 
do something else to terminate the local application session for the user 
associated with that Service Ticket.

Hope that helps.
-Brian
________________________________________
From: Brian Long [[email protected]]
Sent: Friday, March 13, 2009 11:04 AM
To: [email protected]
Subject: Re: [cas-user] single sign out with phpCAS

I see the handleLogoutRequests() API - I'm successfully logging into CAS
and would like to test this logout feature.  Is it as simple as putting
the call to handleLogoutRequests() in my main php page and logging out
via a different browser window?

Thanks in advance
-bml


Pieslak, Brian wrote:
> Thank you very much for the example, Rhian.
>
> After a bit of further investigation I found that I was not using the
> latest phpCAS client, so I have downloaded the latest from here:
> http://www.ja-sig.org/wiki/display/CASC/phpCAS+installation+guide and
> I now see the API for "handleLogoutRequests".
>
> I'm specifically working with Moodle and WordPress, so I'll see how
> their authentication plugins can be used to check for logout requests.
>
> If anyone has already implemented Single Sign Out with phpCAS
> specifically using Moodle or WordPress, that would be a huge help.
>
> Thanks again.
> -Brian
> ------------------------------------------------------------------------
> *From:* Rhian Resnick [[email protected]]
> *Sent:* Thursday, March 12, 2009 9:26 PM
> *To:* [email protected]
> *Subject:* RE:[cas-user] single sign out with phpCAS
>
> We implemented Single Sign Out with phpCAS when we upgraded to CAS
> 3.3. We started with the base phpcas  distribution + an extension to
> support returned attributes.
>
>
>
> The biggest gotcha was that we need to publicize the dns entries our
> CAS servers would be coming from as the CAS servers are part of a
> secure apache cluster.
>
>
>
> I attached an example from our E-Academy authentication.
>
>
>
> -          Rhian
>
>
>
> *From:* Pieslak, Brian [mailto:[email protected]]
> *Sent:* Thursday, March 12, 2009 8:18 PM
> *To:* [email protected]
> *Subject:* [cas-user] single sign out with phpCAS
>
>
>
> Has anyone successfully implemented single sign out with phpCAS?  I
> looked through the available documentation online and I didn't see any
> explicit instructions or examples for implemented SS Out with phpCas,
> so I'm trying to gauge if its worth implemented my own custom solution
> or if I should just punt on the idea.
>
>
>
> Any recommendations from those who use phpCAS?
>
>
>
> Thanks a ton,
>
> -Brian
>
>
>
> --
>
> You are currently subscribed to [email protected] as: [email protected]
>
> To unsubscribe, change settings or access archives, see 
> http://www.ja-sig.org/wiki/display/JSG/cas-user
>
> --
> You are currently subscribed to [email protected] as: 
> [email protected]
> To unsubscribe, change settings or access archives, see 
> http://www.ja-sig.org/wiki/display/JSG/cas-user
>
> --
> You are currently subscribed to [email protected] as: [email protected]
> To unsubscribe, change settings or access archives, see 
> http://www.ja-sig.org/wiki/display/JSG/cas-user


--
You are currently subscribed to [email protected] as: [email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user
-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to