Page MenuHomePhabricator

m.wikidata: login status not detected
Open, Needs TriagePublic

Description

Expected behavior
GIVEN I am successfully logged in on the desktop site, e.g. https://www.wikidata.org/
WHEN I open the mobile site, e.g. https://m.wikidata.org/
THEN I am logged as the same user

Actual behavior
GIVEN I am successfully logged in on the desktop site, e.g. https://www.wikidata.org/
WHEN I open the mobile site, e.g. https://m.wikidata.org/
THEN my logged in status is not detected and I can not make use of it

Technical insights
When opening the mobile login page, e.g. https://m.wikidata.org/w/index.php?title=Special:UserLogin&returnto=Wikidata%3AMain+Page&returntoquery=, the requests that try to facilitate the login can be inspected.
Apparently requests get sent against login.wikimedia.org but are answered in a wrong way for the wikidata domain - the Location header instructs our browser to connect to "https://www.m.wikidata.org/..." which is incorrect (stray "www.").

Applies to both production and beta.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 14 2019, 12:55 PM

Seems to also happen for mediawiki.org.
Does not happen on test.wikidata.org.

Network connection stack trace:
...
https://login.wikimedia.org/wiki/Special:CentralAutoLogin/checkLoggedIn?type=script&wikiid=wikidatawiki&mobile=1&proto=https&mobile=1
https://www.m.wikidata.org/wiki/Special:CentralAutoLogin/createSession?token=...&type=script&proto=https&mobile=1

I believe (but I do not claim to be right on this one) the issue happens inside https://github.com/wikimedia/mediawiki-extensions-CentralAuth/blob/e7ff08db5325ba0d1a4728dcc3d70df06a0cec7f/includes/specials/SpecialCentralAutoLogin.php#L608-L625

Not very extensive testing around MobileContext::getMobileUrl has not identify issues over there. Current working hypothesis of mine is that it is WikiMap::getForeignURL what adds the superfluous www. to the URL.

Would be great to get word from the MediaWiki-extensions-CentralAuth people if they have a suspicion where this problem originates from.

WMDE-leszek triaged this task as High priority.Jun 17 2019, 2:25 PM

Pinging maintainers according to https://www.mediawiki.org/wiki/Developers/Maintainers: @hoo, @vvv, @csteipp, @Legoktm: any idea why mediawiki.org and wikidata.org might behave special (and arguably incorrect)?

WMDE-leszek lowered the priority of this task from High to Normal.Jun 17 2019, 3:44 PM
Lea_WMDE moved this task from Backlog to Other on the Wikidata-Termbox board.
Pablo-WMDE updated the task description. (Show Details)Jun 18 2019, 8:26 AM

It is a bit concerning to see this has not been triaged by the maintainers after more than 3 weeks.

WMDE-leszek raised the priority of this task from Normal to Needs Triage.Jul 22 2019, 1:04 PM
WMDE-leszek added a subscriber: Reedy.

Trying the ping again: @hoo, @vvv, @csteipp, @Legoktm: any idea why mediawiki.org and wikidata.org might behave in "special" way (and arguably incorrect)?
Also, I dare to ping @Reedy as the second most active code contributor according to github, maybe he has an idea what the issue here, or know who would be able to say something about.

Also, I reverted the priority triage of this task, as it is not our code/bug.

Addshore added a subscriber: Addshore.

Also going to tag MediaWiki-Authentication-and-authorization as it could be related and likely to catch some more eyes.

My hunch would be that this has to do with the CA cookie domain for things like wikipedia being set to ".wikipedia.org" but the domain for wikidata gets set to "www.wikidata.org".

Which would mean this related to wgCentralAuthLoginWiki which is documented on https://www.mediawiki.org/wiki/Extension:CentralAuth and also our default settings for that var which can be found in InitialiseSettings.php

		'.wikipedia.org' => 'enwiki',
		'meta.wikimedia.org' => 'metawiki',
		'.wiktionary.org' => 'enwiktionary',
		'.wikibooks.org' => 'enwikibooks',
		'.wikiquote.org' => 'enwikiquote',
		'.wikisource.org' => 'enwikisource',
		'commons.wikimedia.org' => 'commonswiki',
		'.wikinews.org' => 'enwikinews',
		'.wikiversity.org' => 'enwikiversity',
		'.mediawiki.org' => 'mediawikiwiki',
		'www.wikidata.org' => 'wikidatawiki',
		'species.wikimedia.org' => 'specieswiki',
		'incubator.wikimedia.org' => 'incubatorwiki',
		'.wikivoyage.org' => 'enwikivoyage',

Needs a bit more investigation thoguh