Extension talk:Shibboleth Authentication

= update for mediawiki 1.11 = i tried to run the plugin on an 1.11 wiki and had to change a few things: --- ShibAuthPlugin.php.orig    2007-12-14 15:59:31.000000000 +0100 +++ ShibAuthPlugin.php.mw1.11  2008-01-15 10:21:18.000000000 +0100 @@ -285,6 +285,11 @@                        $shib_AssertionConsumerServiceURL. "/WAYF/". $shib_WAYF. '?target='. (isset($_SERVER['HTTPS']) ? 'https' : 'http'). '://' . $_SERVER['HTTP_HOST']. $pageurl, ); + +       // added to hide the manual login (may not be necessary in your config) +        $personal_urls['login']=null; + +        return true;             } /* Kill logout link */ @@ -301,7 +306,13 @@         if($shib_RN && $shib_map_info)                 $personal_urls['userpage']['text'] = $shib_RN; +        +        // added to hide the manual login (may not be necessary in your config) +        $personal_urls['login']=null; +        return true; } + /* Tries to be magical about when to log in users and when not to. */ function AutoAuth(&$user) @@ -328,10 +339,12 @@         //They already with us?  If so, nix this function, we're good.         if($user->isLoggedIn)         { -                BringBackAA; -                return; +           BringBackAA; +           return true;         } - + + +         //Is the user already in the database?         if (User::idFromName($shib_UN) != null) { @@ -342,7 +355,7 @@                $shib_map_info = $smi; $user->SetupSession; $user->setCookies; -               return; +               return true; }        //Place the hook back (Not strictly necessarily MW Ver >= 1.9) @@ -397,7 +410,7 @@        //Now we _do_ the black magic $lf->mRemember = false; -       $lf->initUser($user); +       $lf->initUser($user,true); //Stop pretending now $shib_pretend = false; @@ -406,6 +419,7 @@        $user->saveSettings; $user->setupSession; $user->setCookies; +       return true; }

and it seems to work great now. Peterjacobs

"return true;" added in function SSOLinkAdd

= Ammended patch file for MW 1.11.2 = Thanks(!) for Peter Jacobs for the patch. However it did not work for me out of the box. So I fixed the patch (BringBackAA function really) and am including patch instructions below:

Install Patch

 * 1) Create a file called ShibAuthPlugin.patch in your extensions folder.
 * 2) Copy and paste the code below into it.
 * 3) Make a backup of ShibAuthPlugin.php
 * 4) Patch the extension

cd extensions vi ShibAuthPlugin.patch \\ copy and paste code cp ShibAuthPlugin.php ShibAuthPlugin.php.bak patch ShibAuthPlugin.php ShibAuthPlugin.patch

If you need to reverse the patch, just type patch -R ShibAuthPlugin.php ShibAuthPlugin.patch

Patch
--- ShibAuthPlugin.php.orig	2008-03-06 15:02:25.000000000 -0500 +++ ShibAuthPlugin.php.new	2008-03-06 15:17:53.000000000 -0500 @@ -275,7 +275,7 @@ function SSOLinkAdd(&$personal_urls, $ti       if (! isset($shib_Https))               $shib_Https = false;        $pageurl = $title->getLocalUrl; - +        if (!isset($shib_LoginHint))                $shib_LoginHint = "Login via Single Sign-on";

@@ -285,6 +285,7 @@ function SSOLinkAdd(&$personal_urls, $ti                       $shib_AssertionConsumerServiceURL . "/WAYF/" . $shib_WAYF .                        '?target=' . (isset($_SERVER['HTTPS']) ? 'https' : 'http') .                       '://' . $_SERVER['HTTP_HOST'] . $pageurl, ); +		return true; }

/* Kill logout link */ @@ -301,6 +302,7 @@ function SSOActive(&$personal_urls, $tit

if($shib_RN && $shib_map_info) $personal_urls['userpage']['text'] = $shib_RN; +	return true; }

/* Tries to be magical about when to log in users and when not to. */ @@ -329,7 +331,7 @@ function AutoAuth(&$user) if($user->isLoggedIn) {               BringBackAA; -               return; +               return true; }

//Is the user already in the database? @@ -342,12 +344,11 @@ function AutoAuth(&$user) $shib_map_info = $smi; $user->SetupSession; $user->setCookies; -               return; +               return true; }

//Place the hook back (Not strictly necessarily MW Ver >= 1.9) -       BringBackAA; - +       #BringBackAA; //Okay, kick this up a notch then... $user->setName($wgContLang->ucfirst($shib_UN));

@@ -382,8 +383,7 @@ function AutoAuth(&$user) $lf = new LoginForm($wgRequest);

//Place the hook back (Not strictly necessarily MW Ver >= 1.9) -       BringBackAA; - +       #BringBackAA; //And now we clean up our hack if($wgLangUnset == true) { @@ -397,7 +397,7 @@ function AutoAuth(&$user)

//Now we _do_ the black magic $lf->mRemember = false; -       $lf->initUser($user); +       $lf->initUser($user,true);

//Stop pretending now $shib_pretend = false; @@ -418,5 +418,6 @@ function BringBackAA if($value == 'BringBackAA') $wgHooks['AutoAuthenticate'][$key] = 'AutoAuth'; } +	return true; } ?>

--Jonauman 20:59, 6 March 2008 (UTC)