Extension talk:CASAuthentication

Hello,

I've had some difficulties having your extension redirect to our cas server so I changed a condition. Moreover, we previously used ldap plugin as auth backend and would prefer to keep it active as backend (if our cas server crashed, we would need the documentation in the wiki ;-)

Here's a small patch about this :

19d18 < 33c32 < $wgHooks['UserLoginForm'][] = 'CASOverrideLoginPage'; --- > #$wgHooks['UserLoginForm'][] = 'CASOverrideLoginPage'; 90,93c89,91 < <    if (isset($_REQUEST['title'])) { <        if ($_REQUEST['title'] == 'Special:UserLogin') { <            # Initialise common code --- > >     if ( $_SESSION['wsUserName'] == NULL && $_REQUEST['title'] != 'Special:Connexion') { > 102a101 > 107c106 < --- > 132c131 <                      $user = $u; --- >          $user = $u; 134,136c133,135 <         } else     if ($_REQUEST['title'] == 'Special:Userlogout') { <            phpCAS::logout; <        } --- > #        } else     if ($_REQUEST['title'] == 'Special:Userlogout') { > #           phpCAS::logout; > #      }

Regards,

Mikael Kermorgant

Confusion Regarding Require Statements
I think you need to be more specific regarding the two conflicting require_once statements:

require_once( $IP."/extensions/CASAuth/CASAuth.php" );

vs.

require_once( $IP."/extensions/CASAuthentication/CASAuth.php" );

Also... what is this supposed to mean?

$_phpCasPath = "$IP/extensions/CASAuth/CAS";

Log-out problems
I found that log-outs were not fully successful as they left MediaWiki with a still-intact session after phpCAS::logout was called. Making the following change to the extension causes MediaWiki to go through its full logout process and then call the casLogout function via its UserLogoutComplete hook.

143,147c143,145 <        } else if ($_REQUEST['title'] == $lg->specialPage('Userlogout')) { <            //needed to logout <            phpCAS::client($_phpCASVersion,$_phpCASURL,$_phpCASPort,$_phpCASURLsub); <            phpCAS::logout; <        } --- >         } else if ($_REQUEST['title'] == $lg->specialPage('Userlogout')) { >            $user->logout; >        }

--Adamfranco 18:59, 6 May 2009 (UTC)


 * I have applied this fix to my wiki now. It really should be applied to Extension:CASAuthentication. --81.235.209.68 09:09, 19 July 2009 (UTC)

I have now applied this to the code to the extension page. Maybe the version number and date should be updated? --81.235.209.68 11:10, 19 July 2009 (UTC)

session data
I tried using your extension and I was able to get it to half work, I found that according to phpCAS, I'm logged in however mediawiki still treats me as an anonymous user. It seems to me that there is a problem communicating the sessions data between CASphp and mediawiki, do you have any ideas on what could be causing this problem? thanks for any help that you can give redekopmark 17:59, 11 June 2009 (UTC)
 * I am experiencing this as well. Have you managed to find the problem? --81.235.209.68 16:06, 17 July 2009 (UTC)
 * I believe I found the solution to this. The fact that you are an anonymous user is because that user does not exist on MediaWiki. You must config CASAuth so that it can create accounts on the wiki. It makes a lot of sense if you think about it. --81.235.209.68 09:09, 19 July 2009 (UTC)
 * I have added a note about this on the extension page. --81.235.209.68 11:10, 19 July 2009 (UTC)


 * thanks 81.235.209.68 your awesome! redekopmark 05:20, 22 July 2009 (UTC)

Cleaned and new version
Hi everyone. I have cleaned this extension, but before I edit the extension page, I want to let you know of the changes.

In the old version, the login stuff is half-broken. When the user is logged in, he still gets to the login page. The login page code is also weird, it defines some variables which are never used ($q, $linkq and $linkmsg). I don't even understand what good that login page does. In my new version, I have simply just removed the custom login page, and the login hook correctly redirects the user to the page specified by the returnto parameter.

I have also cleaned up the configuration variables to a single array, and given them better descriptions.

Fair to say, this is a much cleaner version.

If there are no objections within a few weeks, I will eventually integrate the changes into the extension page.

For the record, I was 81.235.209.68. My real name is Stefan Sundin. --81.226.241.234 17:21, 16 August 2009 (UTC)


 * Hi, Thank you for your plugin. I get it work without any problem except that after authenticate successfully!. I close browser and try access wiki page but mediawiki still require me click on url "Log in" ( just click on url no require typing user name + password) Could this plug in do a magic that do not require us click on log in in mediawiki? Phu, —The preceding unsigned comment was added by Jonathanpham  (talk • contribs)  07:23, 20 August 2009 . Please sign your posts with ~ !

Hi. Do you mean that the old page is cached? You could try to add ?action=purge to your bookmark, it should make it certain that you don't get a cached page back. I am not sure if I do the redirect properly though. You might want to get an experienced mediawiki developer to take a look at my redirect code and ask if it can be done better. :) --93.182.181.52 12:48, 20 August 2009 (UTC)

After few day I came with my local wiki & CAS everything is working well now. Strange may be cache issue Thank you so much


 * I am now going to incorporate the changes to the extension page now. For the record, I am 81.226.241.234, I just figure that my work on this extension isn't enough for me to create an account here. Anyway, hopefully I don't need to improve it anymore. --92.254.212.78 18:00, 5 September 2009 (UTC)

Thank you for this incredibly useful extension. After the 1.1 update everything is now working like a charm. Regarding the caching issues that some folks are encountering, I was able to fix this after finding this article on disabling caching. Hope that helps. Amygreene 17:02, 12 October 2009 (UTC)

Compatibility whith 1.15.3 version?
I've some problem whith this extension and the 1.15.3 version of mediawiki (It's ok with 1.15.2). Someone can me confirm if this extension is compatible with the latest stable version of mediawiki? Petit 16:15, 23 April 2010