Page MenuHomePhabricator

Set up sso.wikimedia.beta.wmflabs.org with config-layer routing to other wikis
Closed, ResolvedPublic

Description

To explore implementing T363695: Create a Wikimedia login domain that can be served by any wiki in the configuration layer, create the sso.wikimedia.beta.wmflabs.org domain and add routing logic to CommonsSettings-labs.php (or some similar file) such that https://sso.wikimedia.beta.wmflabs.org/<wiki-domain>/<path> gets loaded as https://<wiki-domain>/<path> (e.g. https://sso.wikimedia.beta.wmflabs.org/en.wikipedia.beta.wmflabs.org/wiki/Special:Userlogin gets loaded as https://en.wikipedia.beta.wmflabs.org/wiki/Special:Userlogin), with a global flag that can be used elsewhere in the configuration to alter how the logic works.


Now live in beta: https://sso.wikimedia.beta.wmflabs.org/en.wikipedia.beta.wmflabs.org/wiki/Special:Userlogin
With simplified interface: https://sso.wikimedia.beta.wmflabs.org/en.wikipedia.beta.wmflabs.org/wiki/Special:Userlogin?display=popup

Event Timeline

Tgr moved this task from Ready to In progress on the SUL3 board.

Change #1036230 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[operations/puppet@production] [POC][beta] Add rewrite rule for sso.wikimedia.beta.wmflabs.org

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

Change #1036245 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[operations/mediawiki-config@master] [WIP][POC] Handle sso.wikimedia.org domain

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

Change #1038331 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/CentralAuth@master] [WIP][POC] Add SSO domain handling

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

Change #1036230 merged by JHathaway:

[operations/puppet@production] [beta] Add rewrite rule for sso.wikimedia.beta.wmflabs.org

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

Change #1038331 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] Add SSO domain handling

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

Change #1036245 merged by jenkins-bot:

[operations/mediawiki-config@master] Handle sso.wikimedia.org domain

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

Mentioned in SAL (#wikimedia-operations) [2024-07-16T13:20:15Z] <tgr@deploy1002> Started scap sync-world: Backport for [[gerrit:1036245|Handle sso.wikimedia.org domain (T365162)]]

Mentioned in SAL (#wikimedia-operations) [2024-07-16T13:22:44Z] <tgr@deploy1002> tgr: Backport for [[gerrit:1036245|Handle sso.wikimedia.org domain (T365162)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-07-16T13:39:22Z] <tgr@deploy1002> Finished scap: Backport for [[gerrit:1036245|Handle sso.wikimedia.org domain (T365162)]] (duration: 19m 07s)

Per (1), smaller bugs that still need to be fixed:

  • captcha images don't load
  • ResourceLoader mostly works, but there are a few requests to load.php which don't use the SSO prefix (and fail).
  • not all allow-listed action API endpoints work, we probably need to allow-list the query module itself too.

FIXMEs from rECAU925a6ff9b95f: Add SSO domain handling that we should follow up on if we are confident we are going to use this in production:

  • when using the restricted shared domain, rest.php just throws a RuntimeException. There should probably be a hook like ApiCheckCanExecute where one can disable REST endpoints.
  • some errors that can be triggered by a user (although not as part of normal behavior) go to production error channels
  • the list of API endpoints etc. that are allowed on the shared domain is currently hardcoded, there should be a way for other extensions to add things

Harmless but weird: API parameter checks run before ApiCheckCanExecute so something like https://sso.wikimedia.beta.wmflabs.org/en.wikipedia.beta.wmflabs.org/w/api.php?action=edit&token=123 will give an error that makes one think the module is not disabled (even though actually it is).

  • Logging in works but results in an error page "The provided authentication token is either expired or invalid."
  • Not strictly related to this task but we should take the opportunity to Host-prefix cookies.
  • non-traffic cookies: loginnotify_prevlogins, centralauth_Session, centralauth_User, ssoUserID, ssoUserName, enwikiSession - what's up with that last one?
  • there are a zillion links that go to sso... and so don't work. We knew this would be the case, but will have to fix it somehow.
  • source maps don't load. The URLs look legit (Chrome doesn't let me copy them, but they use the normal domain) so not sure if it's related.

ResourceLoader mostly works, but there are a few requests to load.php which don't use the SSO prefix (and fail).

The issue seems to be with the sources array passed to ResourceLoader's loader script.

captcha images don't load

These use Special:Captcha so either we whitelist that or we need to point these back to the original wiki.

Change #1054900 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/CentralAuth@master] SUL3: Allow-list some more APIs and special pages

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

Change #1054901 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[operations/mediawiki-config@master] SUL3: Fix cookie names on the SSO domain

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

Change #1054900 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] SUL3: Allow-list some more APIs and special pages

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

Change #1054911 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[operations/mediawiki-config@master] SUL3: Fix URL handling for the SSO domain

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

Change #1054931 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/core@master] resourceloader: Support cross-domain load.php requests

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

Logging in works but results in an error page "The provided authentication token is either expired or invalid."

That is centralauth-error-badtoken. So this is from the new RedirectingLoginHookHandler which should handle a valid local login more gracefully. Can be handled as part of T363699: Determine and implement SUL 3 login handshake mechanism.

Change #1054901 merged by jenkins-bot:

[operations/mediawiki-config@master] SUL3: Fix cookie names on the SSO domain

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

Mentioned in SAL (#wikimedia-operations) [2024-07-17T20:04:57Z] <tgr@deploy1002> Started scap sync-world: Backport for [[gerrit:1054901|SUL3: Fix cookie names on the SSO domain (T365162)]]

Mentioned in SAL (#wikimedia-operations) [2024-07-17T20:07:35Z] <tgr@deploy1002> tgr: Backport for [[gerrit:1054901|SUL3: Fix cookie names on the SSO domain (T365162)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-07-17T20:14:20Z] <tgr@deploy1002> Finished scap: Backport for [[gerrit:1054901|SUL3: Fix cookie names on the SSO domain (T365162)]] (duration: 09m 23s)

Change #1054911 merged by jenkins-bot:

[operations/mediawiki-config@master] SUL3: Fix URL handling for the SSO domain

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

Mentioned in SAL (#wikimedia-operations) [2024-07-17T20:18:29Z] <tgr@deploy1002> Started scap sync-world: Backport for [[gerrit:1054911|SUL3: Fix URL handling for the SSO domain (T365162)]]

Mentioned in SAL (#wikimedia-operations) [2024-07-17T20:53:31Z] <tgr@deploy1002> tgr: Backport for [[gerrit:1054911|SUL3: Fix URL handling for the SSO domain (T365162)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-07-17T21:01:03Z] <tgr@deploy1002> Finished scap: Backport for [[gerrit:1054911|SUL3: Fix URL handling for the SSO domain (T365162)]] (duration: 42m 33s)

Change #1057005 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/CentralAuth@master] SUL3: Expand ResourceLoader URLs

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

Change #1054931 merged by jenkins-bot:

[mediawiki/core@master] resourceloader: Add ResourceLoaderModifyStartupSourceUrls hook

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

Change #1057005 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] SUL3: Expand ResourceLoader URLs

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

Change #1060093 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] SUL3: Make restrictions on the SSO domain optional

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