Topic on Extension talk:Auth remoteuser

Infinite Loop encounterd

4
Inlimity (talkcontribs)

Currently this extension did cause an infinite loop for me, causing the entire wiki to not allow any login:


[...]

#493 /usr/share/webapps/mediawiki/extensions/Auth_remoteuser/src/UserNameSessionProvider.php(509): MediaWiki\User\User->isAllowed(string)

#494 /usr/share/webapps/mediawiki/includes/session/SessionManager.php(867): MediaWiki\Extension\Auth_remoteuser\UserNameSessionProvider->refreshSessionInfo(MediaWiki\Session\SessionInfo, MediaWiki\Request\WebRequest, array)

#495 /usr/share/webapps/mediawiki/includes/session/SessionManager.php(558): MediaWiki\Session\SessionManager->loadSessionInfoFromStore(MediaWiki\Session\SessionInfo, MediaWiki\Request\WebRequest)

#496 /usr/share/webapps/mediawiki/includes/session/SessionManager.php(245): MediaWiki\Session\SessionManager->getSessionInfoForRequest(MediaWiki\Request\WebRequest)

#497 /usr/share/webapps/mediawiki/includes/Request/WebRequest.php(870): MediaWiki\Session\SessionManager->getSessionForRequest(MediaWiki\Request\WebRequest)

#498 /usr/share/webapps/mediawiki/includes/Permissions/PermissionManager.php(1594): MediaWiki\Request\WebRequest->getSession()

#499 /usr/share/webapps/mediawiki/includes/Permissions/PermissionManager.php(1536): MediaWiki\Permissions\PermissionManager->getUserPermissions(MediaWiki\User\User)

#500 /usr/share/webapps/mediawiki/includes/Permissions/UserAuthority.php(285): MediaWiki\Permissions\PermissionManager->userHasRight(MediaWiki\User\User, string)

#501 /usr/share/webapps/mediawiki/includes/Permissions/UserAuthority.php(144): MediaWiki\Permissions\UserAuthority->internalAllowed(string, NULL, boolean, NULL)

#502 /usr/share/webapps/mediawiki/includes/user/User.php(2292): MediaWiki\Permissions\UserAuthority->isAllowed(string, NULL)

#503 /usr/share/webapps/mediawiki/extensions/Auth_remoteuser/src/UserNameSessionProvider.php(509): MediaWiki\User\User->isAllowed(string)

#504 /usr/share/webapps/mediawiki/includes/session/SessionManager.php(867): MediaWiki\Extension\Auth_remoteuser\UserNameSessionProvider->refreshSessionInfo(MediaWiki\Session\SessionInfo, MediaWiki\Request\WebRequest, array)

#505 /usr/share/webapps/mediawiki/includes/session/SessionManager.php(558): MediaWiki\Session\SessionManager->loadSessionInfoFromStore(MediaWiki\Session\SessionInfo, MediaWiki\Request\WebRequest)

#506 /usr/share/webapps/mediawiki/includes/session/SessionManager.php(245): MediaWiki\Session\SessionManager->getSessionInfoForRequest(MediaWiki\Request\WebRequest)

#507 /usr/share/webapps/mediawiki/includes/Request/WebRequest.php(870): MediaWiki\Session\SessionManager->getSessionForRequest(MediaWiki\Request\WebRequest)

#508 /usr/share/webapps/mediawiki/includes/session/SessionManager.php(166): MediaWiki\Request\WebRequest->getSession()

#509 /usr/share/webapps/mediawiki/includes/Setup.php(487): MediaWiki\Session\SessionManager::getGlobalSession()

#510 /usr/share/webapps/mediawiki/includes/WebStart.php(85): require_once(string)

#511 /usr/share/webapps/mediawiki/index.php(50): require(string)

#512 {main}


Somewho the call to $user->isAllowed( 'createaccount' ) in line 509 of UserNameSessionProvider.php causes an infinite loop. I have

$wgGroupPermissions['*']['autocreateaccount'] = true;

$wgGroupPermissions['*']['createaccount'] = false;

in my LocalSettings.php


I just replacing line 509 in that file with if (true), the wiki does somewhat work again. However, I'm not sure what happens with new users.

193.54.89.80 (talkcontribs)

Dear devs,

I have exactly the same problem with the same settings

Thank you for your help.

184.68.205.162 (talkcontribs)

Hello, I can confirm I'm encountering the exact same infinite loop.

MEdiaWiki 1.42, Auth_RemoteUser git version 2.1.0-94-g4878ba4 .

The REMOTE_USER is passed from nginx correctly to php-fpm ( debug-printing $_SERVER["REMOTE_USER"] from LocalSettings.php prints the correct email ) .

Enabling logging, this message repeats:


```

[session] Setting up auto login session for remote user name 'me@example.com' (mapped to MediaWiki user 'Me@example.com', currently active as MediaWiki user 'Me@example.com').

[rdbms] Wikimedia\Rdbms\LoadBalancer::reuseOrOpenConnectionForNewRef: reusing connection for 0/my_wiki

[rdbms] MediaWiki\User\User::load [0.126ms] localhost: SELECT  actor_id,actor_user,actor_name  FROM `actor`    WHERE actor

_name = 'Me@example.com'  LIMIT 1

```

Not sure if it matters, but the REMOTE_USER contains lower case email, and is mapped to Upper case first letter for the SQL .

174.0.239.6 (talkcontribs)

Follow-up to my previous comment:

  1. Removing the "if()" in UserNameSessionProvider.php:509 was needed but not sufficient (thanks to the user above who suggested it).
  2. The username (set by NGINX in HTTP_REMOTE_USER) needs to *already exist* in the "actor" table for this to work for me - it is not created automatically by Auth_RemoteUser despite both settings "createaccount" and "autocreateaccoutn" being true. Perhaps there's some missing option that's required but not documented ?
Reply to "Infinite Loop encounterd"