Page MenuHomePhabricator

WIkiGrok doesn't save when not logged in
Closed, ResolvedPublic

Description

When $wgWikiGrokUIEnableForAnons is set to True, I see a WikiGrok dialog, but when submitting my response, I get the following error:

Anonymous users cannot obtain a centralauthtoken

Event Timeline

bmansurov raised the priority of this task from to Needs Triage.
bmansurov updated the task description. (Show Details)
bmansurov added a subscriber: bmansurov.
bmansurov triaged this task as Unbreak Now! priority.Apr 24 2015, 12:27 AM

@Jdlrobson says that ForeignApi doesn't work for anonymous users.

This is because you can't do CORs requests (cross domain requests) for anonymous users. CentralAuth only allows you to do that when logged in.
In our terms this means ForeignApi postWithToken will only work when you are logged in

You'll need to move this API to English Wikipedia...

This is because you can't do CORs requests (cross domain requests) for anonymous users. CentralAuth only allows you to do that when logged in.

Yes, CentralAuth is for logged in users only. Just use a normal logged out token (+\) and it should work.

Change 211884 had a related patch set uploaded (by Bmansurov):
ForeignApi: Allow posting for anonymous users

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

@bmansurov please reply to my comment on the patch. Please check the line is not redundant.

Change 211884 merged by jenkins-bot:
ForeignApi: Allow posting for anonymous users

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

phuedx removed a project: Patch-For-Review.

Shout out to @bmansurov and @Legoktm for fixing this.