Page MenuHomePhabricator

Two-account workflow is not available with OAuth
Open, NormalPublic

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

Tgr created this task.Aug 6 2016, 6:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 6 2016, 6:40 PM
Anomie added a subscriber: Anomie.Aug 7 2016, 9:19 PM

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.

Masti added a subscriber: Masti.Nov 28 2016, 6:42 PM
Restricted Application added a subscriber: pywikibot-bugs-list. · View Herald TranscriptMar 23 2019, 10:14 PM
Huji added a subscriber: Huji.Aug 17 2019, 12:55 PM

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

Huji added a comment.Tue, Aug 27, 8:17 PM

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 Normal priority.Sun, Sep 8, 12:02 PM