Page MenuHomePhabricator

Consider adding $creator to postAuthentication hook
Closed, ResolvedPublic

Description

While working on the instrumentation of account conversions for temporary users T346327, we realized that we need access to the user that attempted the action rather than the user the authentication request is being made for. That is to determine whether the creator is a temporary account or not.

Based on this use case and other possible usages (an extension that allow super-admins to impersonate others, for example) it's worth considering to add a $creator parameter to the hook so it's commonly available

Event Timeline

postAuthentication is defined in an interface so it's very hard to change. What would be easier is to add the performer to AuthManagerLoginAuthenticateAudit (which is also an interface but has an open-ended extra-data array as one of its parameters). Do you want to submit a patch?

Change 1006973 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/core@master] AuthManager: add creator to AuthManagerLoginAuthenticateAudit

https://gerrit.wikimedia.org/r/1006973

postAuthentication is defined in an interface so it's very hard to change. What would be easier is to add the performer to AuthManagerLoginAuthenticateAudit (which is also an interface but has an open-ended extra-data array as one of its parameters). Do you want to submit a patch?

Thanks for the insight. Yes, I submitted a WIP patch where I only replaced AuthManager calls to the hook. I'm missing to review if there are any other usages around. Feedback welcome.

Change 1006973 merged by jenkins-bot:

[mediawiki/core@master] AuthManager: add creator to AuthManagerLoginAuthenticateAudit calls

https://gerrit.wikimedia.org/r/1006973