I've setup a Kerberos/OpenLDAP SSO solution for my group. I'm trying to get mediawiki to authenticate against the kerberos server and use LDAP to get simple user information (like their name and maybe email address). My goal is to not allow new user accounts to be created or anonymous edits and views on the wiki. I have mod_auth_kerb setup and working correctly. I'm getting an error message from mediawiki that I can't figure out. Here is the message:
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'LdapAutoAuthentication::Authenticate' was given in /srv/web/mediawiki-1.13.3/includes/Hooks.php on line 117 Internal error
Detected bug in an extension! Hook LdapAutoAuthentication::Authenticate failed to return a value; should return true to continue hook processing or false to abort.
Backtrace:
#0 /srv/web/mediawiki-1.13.3/includes/User.php(748): wfRunHooks('UserLoadFromSes...', Array) #1 /srv/web/mediawiki-1.13.3/includes/User.php(221): User->loadFromSession() #2 /srv/web/mediawiki-1.13.3/includes/User.php(1732): User->load() #3 /srv/web/mediawiki-1.13.3/includes/User.php(1745): User->getGroups() #4 /srv/web/mediawiki-1.13.3/includes/User.php(1718): User->getEffectiveGroups() #5 /srv/web/mediawiki-1.13.3/includes/User.php(1864): User->getRights() #6 [internal function]: User->isAllowed('read') #7 /srv/web/mediawiki-1.13.3/includes/StubObject.php(58): call_user_func_array(Array, Array) #8 /srv/web/mediawiki-1.13.3/includes/StubObject.php(184): StubObject->_call('isAllowed', Array) #9 [internal function]: StubUser->__call('isAllowed', Array) #10 /srv/web/mediawiki-1.13.3/includes/Title.php(1450): StubUser->isAllowed('read') #11 /srv/web/mediawiki-1.13.3/includes/Wiki.php(149): Title->userCanRead() #12 /srv/web/mediawiki-1.13.3/includes/Wiki.php(54): MediaWiki->preliminaryChecks(Object(Title), Object(OutputPage), Object(WebRequest)) #13 /srv/web/mediawiki-1.13.3/index.php(93): MediaWiki->initialize(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest)) #14 {main}
Here are all of my additions (to the bottom) of my LocalSettings.php file:
# LDAP Authentication require_once('extensions/LdapAuthentication.php');
$wgLDAPDomainNames = array("testing"); $wgLDAPServerNames = array("testing"=>"ldaps.example.com");
$wgLDAPAutoAuthDomain = "testing";
$wgLDAPProxyAgent = array("testing"=>"cn=ldapbrowser,dc=example,dc=com"); $wgLDAPProxyAgentPassword = array("testing"=>"password"); $wgLDAPBaseDNs = array("testing" => "dc=example,dc=com");
$wgLDAPSearchAttributes = array("testing" => "uid");
$wgLDAPAutoAuthUsername = preg_replace( '/@.*/', '', $_SERVER["REMOTE_USER"] );
AutoAuthSetup();
# Prevent new user registrations $wgGroupPermissions['*']['createaccount'] = false; # Restrict anonymous editing $wgGroupPermissions['*']['edit'] = false; # Restrict anonymous reads $wgGroupPermissions['*']['read'] = false;
$wgShowExceptionDetails = true;
$wgLDAPDebug = 3;
I'm running the latest packaged Apache2 and PHP on a Ubuntu 8.04 server. I'm using the latest mediawiki (1.13.3) and Ldap_Authentication extension 1.2a.
Let me know if I can provide any other info to help diagnose this error. I really appreciate the work you've done on the extension and the support!
Thanks, Ken
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'LdapAutoAuthentication::Authenticate' was given in /srv/web/mediawiki-1.13.3/includes/Hooks.php on line 117
Internal error
I could have sworn I tested this in 1.13 and it was working properly, but I may have something messed up in the authenticate() function. Try this:
--- LdapAutoAuthentication.php.old 2009-02-03 17:20:13.460951000 -0600 +++ LdapAutoAuthentication.php 2009-02-03 17:25:08.974031000 -0600 @@ -7,7 +7,16 @@ * * @access public */ - static function Authenticate( $user, &$result ) { + static function AuthenticateAfterLoad( $user ) { + return LdapAutoAuthentication::Authenticate( true, $user ); + } + + /** + * Does the web server authentication piece of the LDAP plugin. + * + * @access public + */ + static function Authenticate( &$result, $user ) { global $wgUser; global $wgAuth; global $wgLDAPAutoAuthUsername;
--- LdapAuthentication.php.old 2009-02-03 17:25:44.236929000 -0600 +++ LdapAuthentication.php 2009-02-03 17:26:13.602250000 -0600 @@ -1741,7 +1741,7 @@ if ( version_compare( $wgVersion, '1.14.0', '<' ) ) { $wgHooks['UserLoadFromSession'][] = 'LdapAutoAuthentication::Authenticate'; } else { - $wgHooks['UserLoadAfterLoadFromSession'][] = 'LdapAutoAuthentication::Authenticate'; + $wgHooks['UserLoadAfterLoadFromSession'][] = 'LdapAutoAuthentication::AuthenticateAfterLoad'; } $wgHooks['PersonalUrls'][] = 'LdapAutoAuthentication::NoLogout'; /* Disallow logout link */ }
V/r,
Ryan Lane
Actually, I looked at the code and realized it was looking for an LdapAutoAuthentication class and it wasn't defined anywhere. I was able to find it in your SVN repository, but I don't see it linked or mentioned on the extension's web page. Anyway, I copied that into my extensions directory and added this line below the LdapAuthentication include in the LocalSettings.php file:
require_once('extensions/LdapAutoAuthentication.php');
I don't get the error now, but now my browser gets stuck trying to load the page and nothing happens. I've checked the apache log on the server and it isn't showing anything from the attempted connect.
I also tried applying your patches to see if that helped and it didn't seem to change anything. The browser still just keeps trying to load and finally gives up after 30 or 40 seconds.
Any suggestions?
Thanks, Ken
On Tue, Feb 3, 2009 at 5:28 PM, Lane, Ryan Ryan.Lane@ocean.navo.navy.milwrote:
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'LdapAutoAuthentication::Authenticate' was given in /srv/web/mediawiki-1.13.3/includes/Hooks.php on line 117
Internal error
I could have sworn I tested this in 1.13 and it was working properly, but I may have something messed up in the authenticate() function. Try this:
--- LdapAutoAuthentication.php.old 2009-02-03 17:20:13.460951000 -0600 +++ LdapAutoAuthentication.php 2009-02-03 17:25:08.974031000 -0600 @@ -7,7 +7,16 @@ * * @access public */
static function Authenticate( $user, &$result ) {
static function AuthenticateAfterLoad( $user ) {
return LdapAutoAuthentication::Authenticate( true, $user
);
}
/**
* Does the web server authentication piece of the LDAP plugin.
*
* @access public
*/
static function Authenticate( &$result, $user ) { global $wgUser; global $wgAuth; global $wgLDAPAutoAuthUsername;
--- LdapAuthentication.php.old 2009-02-03 17:25:44.236929000 -0600 +++ LdapAuthentication.php 2009-02-03 17:26:13.602250000 -0600 @@ -1741,7 +1741,7 @@ if ( version_compare( $wgVersion, '1.14.0', '<' ) ) { $wgHooks['UserLoadFromSession'][] = 'LdapAutoAuthentication::Authenticate'; } else {
$wgHooks['UserLoadAfterLoadFromSession'][] =
'LdapAutoAuthentication::Authenticate';
$wgHooks['UserLoadAfterLoadFromSession'][] =
'LdapAutoAuthentication::AuthenticateAfterLoad'; } $wgHooks['PersonalUrls'][] = 'LdapAutoAuthentication::NoLogout'; /* Disallow logout link */ }
V/r,
Ryan Lane
Mediawiki-enterprise mailing list Mediawiki-enterprise@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-enterprise
Any suggestions on this problem? Any way I can diagnose what is going on here?
Thanks, Ken
On Wed, Feb 4, 2009 at 9:54 AM, Ken Keefe kjkeefe@gmail.com wrote:
Actually, I looked at the code and realized it was looking for an LdapAutoAuthentication class and it wasn't defined anywhere. I was able to find it in your SVN repository, but I don't see it linked or mentioned on the extension's web page. Anyway, I copied that into my extensions directory and added this line below the LdapAuthentication include in the LocalSettings.php file:
require_once('extensions/LdapAutoAuthentication.php');
I don't get the error now, but now my browser gets stuck trying to load the page and nothing happens. I've checked the apache log on the server and it isn't showing anything from the attempted connect.
I also tried applying your patches to see if that helped and it didn't seem to change anything. The browser still just keeps trying to load and finally gives up after 30 or 40 seconds.
Any suggestions?
Thanks, Ken
On Tue, Feb 3, 2009 at 5:28 PM, Lane, Ryan Ryan.Lane@ocean.navo.navy.milwrote:
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'LdapAutoAuthentication::Authenticate' was given in /srv/web/mediawiki-1.13.3/includes/Hooks.php on line 117
Internal error
I could have sworn I tested this in 1.13 and it was working properly, but I may have something messed up in the authenticate() function. Try this:
--- LdapAutoAuthentication.php.old 2009-02-03 17:20:13.460951000 -0600 +++ LdapAutoAuthentication.php 2009-02-03 17:25:08.974031000 -0600 @@ -7,7 +7,16 @@ * * @access public */
static function Authenticate( $user, &$result ) {
static function AuthenticateAfterLoad( $user ) {
return LdapAutoAuthentication::Authenticate( true, $user
);
}
/**
* Does the web server authentication piece of the LDAP plugin.
*
* @access public
*/
static function Authenticate( &$result, $user ) { global $wgUser; global $wgAuth; global $wgLDAPAutoAuthUsername;
--- LdapAuthentication.php.old 2009-02-03 17:25:44.236929000 -0600 +++ LdapAuthentication.php 2009-02-03 17:26:13.602250000 -0600 @@ -1741,7 +1741,7 @@ if ( version_compare( $wgVersion, '1.14.0', '<' ) ) { $wgHooks['UserLoadFromSession'][] = 'LdapAutoAuthentication::Authenticate'; } else {
$wgHooks['UserLoadAfterLoadFromSession'][] =
'LdapAutoAuthentication::Authenticate';
$wgHooks['UserLoadAfterLoadFromSession'][] =
'LdapAutoAuthentication::AuthenticateAfterLoad'; } $wgHooks['PersonalUrls'][] = 'LdapAutoAuthentication::NoLogout'; /* Disallow logout link */ }
V/r,
Ryan Lane
Mediawiki-enterprise mailing list Mediawiki-enterprise@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-enterprise
-- Forti et Fideli nihil difficile – Nothing is difficult to the brave and faithful.
If you aren't getting any error messages, I can't help you diagnose anything. PHP is likely dying on something, and that's what you need to find.
Can you check your LDAP server logs to see what is going on?
-----Original Message----- From: Ken Keefe [mailto:kjkeefe@gmail.com] Sent: Sunday, February 08, 2009 7:19 PM To: mediawiki-enterprise@lists.wikimedia.org; Lane, Ryan Subject: Re: [Mediawiki-enterprise] LdapAutoAuthentication::Authenticate failedto return a value
Any suggestions on this problem? Any way I can diagnose what is going on here?
Thanks, Ken
On Wed, Feb 4, 2009 at 9:54 AM, Ken Keefe kjkeefe@gmail.com wrote:
Actually, I looked at the code and realized it was looking for an LdapAutoAuthentication class and it wasn't defined anywhere. I was able to find it in your SVN repository, but I don't see it linked or mentioned on the extension's web page. Anyway, I copied that into my extensions directory and added this line below the LdapAuthentication include in the LocalSettings.php file:
require_once('extensions/LdapAutoAuthentication.php');
I don't get the error now, but now my browser gets stuck trying to load the page and nothing happens. I've checked the apache log on the server and it isn't showing anything from the attempted connect.
I also tried applying your patches to see if that helped and it didn't seem to change anything. The browser still just keeps trying to load and finally gives up after 30 or 40 seconds.
Any suggestions?
Thanks, Ken
On Tue, Feb 3, 2009 at 5:28 PM, Lane, Ryan Ryan.Lane@ocean.navo.navy.mil wrote:
> Warning: call_user_func_array() > [function.call-user-func-array]: First
argument is expected > to be a valid callback, > 'LdapAutoAuthentication::Authenticate' was given in > /srv/web/mediawiki-1.13.3/includes/Hooks.php on line 117 > > Internal error > I could have sworn I tested this in 1.13 and it was working properly, but I may have something messed up in the authenticate() function. Try this: --- LdapAutoAuthentication.php.old 2009-02-03 17:20:13.460951000 -0600 +++ LdapAutoAuthentication.php 2009-02-03 17:25:08.974031000 -0600 @@ -7,7 +7,16 @@ * * @access public */ - static function Authenticate( $user, &$result ) { + static function AuthenticateAfterLoad( $user ) { + return LdapAutoAuthentication::Authenticate( true, $user ); + } + + /** + * Does the web server authentication piece of the LDAP plugin. + * + * @access public + */ + static function Authenticate( &$result, $user ) { global $wgUser; global $wgAuth; global $wgLDAPAutoAuthUsername; --- LdapAuthentication.php.old 2009-02-03 17:25:44.236929000 -0600 +++ LdapAuthentication.php 2009-02-03 17:26:13.602250000 -0600 @@ -1741,7 +1741,7 @@ if ( version_compare( $wgVersion, '1.14.0', '<' ) ) { $wgHooks['UserLoadFromSession'][] = 'LdapAutoAuthentication::Authenticate'; } else { - $wgHooks['UserLoadAfterLoadFromSession'][] = 'LdapAutoAuthentication::Authenticate'; + $wgHooks['UserLoadAfterLoadFromSession'][] = 'LdapAutoAuthentication::AuthenticateAfterLoad'; } $wgHooks['PersonalUrls'][] = 'LdapAutoAuthentication::NoLogout'; /* Disallow logout link */ } V/r, Ryan Lane _______________________________________________ Mediawiki-enterprise mailing list Mediawiki-enterprise@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-enterprise
-- Forti et Fideli nihil difficile - Nothing is difficult to the brave and faithful.
-- Forti et Fideli nihil difficile - Nothing is difficult to the brave and faithful.
mediawiki-enterprise@lists.wikimedia.org