Page MenuHomePhabricator

Run hook `UserLoggedIn`
Closed, ResolvedPublic


Mediawiki's SessionManager doesn't fire this hook, because it is getting called by the AuthManager only. And it happens in two places. First when processing all AuthenticationProviders (@see setSessionDataForUser in core file include/auth/AuthManager.php). Second when creating a new user automatically (@see autoCreateUser in include/auth/AuthManager.php).

But this Auth_remoteuser extension is a SessionProvider. And only the second case (automatic user creation) can be triggered by us. The first case is missing, because we do not authenticate a user (this is done by our remote authentication source), hence do not running through Mediawiki's AuthManager auth stack.

We should call this hook explicitely when we created a new session for an already known user (because Mediawiki core doesn't do that for us).

Related Objects

Event Timeline

Enst80 created this task.Jan 20 2018, 5:38 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 20 2018, 5:38 PM
Osnard added a subscriber: Osnard.Jan 30 2018, 8:56 AM

Is this commit in Gerrit somewhere?

Change 383845 had a related patch set uploaded (by Zoranzoki21; owner: Robert Vogel):
[mediawiki/extensions/Auth_remoteuser@master] Firing hook 'UserLoggedIn'

Change 383845 merged by jenkins-bot:
[mediawiki/extensions/Auth_remoteuser@master] Firing hook 'UserLoggedIn'

Enst80 claimed this task.Mar 16 2018, 9:26 PM
Enst80 closed this task as Resolved.

Thank you all. New version 2.0.1 released (annotated tag also).

Very cool! Thanks a lot!