Page MenuHomePhabricator

Two-account workflow is not available with OAuth
Closed, ResolvedPublic

Description

Pywikibot normally uses two accounts: a bot account and a sysop account, the latter only for actions which need elevated permissions. When using OAuth as the authentication method, this possibility is not supported.

(IMO separate bot accounts are a relic of the past: OAuth allows you to prevent access to scary permissions like editinterface, and can tag actions that happen through OAuth, so there is no need for a separate account anymore. Workflows have their momentum, though, so it would be nice if it was supported anyway.)

Event Timeline

Note there's no reason it can't support two accounts. It just has to use OAuth credentials for the normal or sysop account as appropriate when sending the request instead of re-logging-in or swapping cookie jars (I don't know which it might do) to switch between the two.

I am not fluent in MW API, so let me ask this: is there a way to ask the API "who am i"? Or "which groups am I a part of"? Because if so, then all Pywikibot has to do is when OAuth is used it should check to make sure it is indeed authenticated using a sysop account before trying each sysop action.

before trying each sysop action.

or just once and then cache the result

I am not fluent in MW API, so let me ask this: is there a way to ask the API "who am i"? Or "which groups am I a part of"?

https://www.mediawiki.org/w/api.php?action=query&meta=userinfo&uiprop=groups

I am not fluent in MW API, so let me ask this: is there a way to ask the API "who am i"? Or "which groups am I a part of"?

https://www.mediawiki.org/w/api.php?action=query&meta=userinfo&uiprop=groups

Fabulous!

Xqt triaged this task as Medium priority.Sep 8 2019, 12:02 PM
Xqt claimed this task.
Xqt subscribed.

Dualism of bot accounts was given up years ago

Xqt removed Xqt as the assignee of this task.Sep 26 2022, 10:53 PM