Page MenuHomePhabricator

pywikibot: Support OAuth2 token
Open, MediumPublicFeature

Description

Feature summary:
I would like pywikibot to be able to run when provided an OAuth2 access token, maybe per request.

Use case(s):
It would allow writing a webservice that authenticates using OAuth2 and then passing the token to a function.

Benefits:
It would make it possible to run scripts via OAuth2.

Event Timeline

Xqt triaged this task as Medium priority.Nov 26 2022, 2:50 PM
Xqt updated the task description. (Show Details)
Xqt added a project: Pywikibot-Login.

Note that in the future what we'd like to recommend for bots is OAuth 2 client credentials (so rather than storing an access token in the configuration, you store the client ID and secret, and then the bot can use some standard OAuth library to fetch a new access token every few hours). It's not actually supported yet, though.

T407987: Define best practice for single-user apps which need a high MediaWiki API rate limit has more context.

Xqt changed the task status from Open to Stalled.Mar 13 2026, 2:15 PM

I would postpone it until client credentials flow is implemented upstream,
See https://api.wikimedia.org/wiki/Authentication

Xqt changed the task status from Stalled to Open.Sun, Apr 5, 9:16 AM

Implemtation of owner-only-tokens is proposed
https://www.mediawiki.org/wiki/OAuth/Owner-only_consumers#OAuth_2