Page MenuHomePhabricator

CentralAuthForeignRest changes POST to GET when requesting CentralAuth tokens
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Issue a POST request with ForeignRest, for example
const api = new mw.ForeignApi( 'https://en.wikipedia.org/w/api.php' );
const restApi = new mw.ForeignRest( 'https://en.wikipedia.org/w/rest.php', api );
api.getToken( 'csrf' ).then( ( token ) => {
    restApi.post( '/checkuser/v0/batch-temporaryaccount', { token: token, users: {} } );
} );

What happens?:
405 Method Not Allowed is returned. Looking into Network tab in DevTools suggests that the request was actually sent as GET.

What should have happened instead?:
The request should have been sent as POST.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
mszwarc renamed this task from ForeignRest changes POST to GET when requesting CentralAuth tokens to CentralAuthForeignRest changes POST to GET when requesting CentralAuth tokens.Apr 13 2026, 2:46 PM
mszwarc updated the task description. (Show Details)

Change #1270469 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/extensions/CentralAuth@master] Fix CentralAuthForeignRest getting tokens for POST requests

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

Change #1270479 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/CentralAuth@master] ForeignRest: Fix issuing all requests as GET

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

Change #1270479 abandoned by Bartosz Dziewoński:

[mediawiki/extensions/CentralAuth@master] ForeignRest: Fix issuing all requests as GET

Reason:

Oops, I didn't realize there was already a patch, sorry

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

Change #1270469 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] Fix CentralAuthForeignRest getting tokens for POST requests

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

matmarex claimed this task.