Page MenuHomePhabricator

Merge WebAuthn extension into OATHAuth
Closed, ResolvedPublic

Description

OATHAuth provides the infrastructure for 2FA support, and contains a TOTP code-based module provider. It's also bundled with the tarball. WebAuthn extends upon that by adding a provider for Yubikeys and similar devices.

It would be easier to make changes to OATHAuth if all the code was contained in the same Git repository. Also these days WebAuthn is an well-known standard and for 2FA purposes, using security keys is generally expected as an addition to TOTP. It would be good if we could ship both with minimal setup.

Given that we do want to bundle WebAuthn (T258007: Bundle WebAuthn extension with MediaWiki), merging would be another way to get to that goal.

The main blocker is the current WebAuthn library depends on the gmp extension, which the tarball currently doesn't. That dependency should be removed or be made a core dependency.

Event Timeline

Legoktm triaged this task as Low priority.

The main blocker is the current WebAuthn library depends on the gmp extension, which the tarball currently doesn't. That dependency should be removed or be made a core dependency.

Unless I'm missing something, it doesn't actually.

A few of the dependencies in require have ext-bcmath and/or ext-gmp in suggest... And that is only for performance reasons, suggesting there's fallbacks in most (all?) of them

They both provide secondary authenication factors, and quite different ones. Conceptually there shouldn't be much reason to merge. If one depends on the other, that might be a sign that the common piece of functionality should be in core?

They both provide secondary authenication factors, and quite different ones. Conceptually there shouldn't be much reason to merge.

Indeed, it's mostly for practical reasons:

  • Easier to refactor OATHAuth if all the code was in one Git repository
  • Easier for sysadmins to enable 2FA support on their wiki if it's just one extension rather than two

If one depends on the other, that might be a sign that the common piece of functionality should be in core?

Maybe... 🤔

FWIW, the main reason it was split originally was it required newer PHP version than WMF had at the time, so it was easier to split it and allow development in a seperate (non deployed, at the time) repo...

Change #1221160 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/WebAuthn@master] Empty extension to noop

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

Change #1221161 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/OATHAuth@master] Merge WebAuthn into OATHAuth

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

Will need to decide how to handle the message files for twn purposes...

Will need to decide how to handle the message files for twn purposes...

Depends on what you want as an end result. Probably first easy step is to move en/qqq.json as separate files to the other extension and remove from the other. Later those can be renamed and files merged if needed. Whether or not BC is needed we would likely drop the other extension completely from translatewiki.

Change #1233299 had a related patch set uploaded (by Reedy; author: Reedy):

[translatewiki@master] mediawiki-extensions.txt: Move WebAuthn message files to point to OATHAuth

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

Reedy changed the task status from Open to In Progress.Jan 26 2026, 10:37 PM
Reedy claimed this task.

Change #1233679 had a related patch set uploaded (by Reedy; author: Reedy):

[operations/mediawiki-config@master] CommonSettings.php: Stop loading WebAuthn

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

Change #1233680 had a related patch set uploaded (by Reedy; author: Reedy):

[operations/mediawiki-config@master] wmf-config: Remove $wmgUseWebAuthn and extension from extension-list

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

Change #1221160 merged by jenkins-bot:

[mediawiki/extensions/WebAuthn@master] Empty extension to noop

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

Change #1221161 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@master] Merge WebAuthn into OATHAuth

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

Change #1233686 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/OATHAuth@master] Cleanup post merge of WebAuthn into OATHAuth

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

Change #1233687 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/OATHAuth@master] i18n: Remove webauthn-desc message

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

Change #1233691 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/OATHAuth@master] Re-namespace WebAuthn into OATHAuth

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

Change #1233299 merged by jenkins-bot:

[translatewiki@master] mediawiki-extensions.txt: Move WebAuthn message files to point to OATHAuth

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

I think the main outstanding things (patches still to be made) is to decide what we want to do about the i18n files going forward.

Do we want to merge the WebAuthn files into the OATHAuth ones? And if so, do we want to rename the message keys?

I don't think it's necessarily a bad thing for them to be different prefixed, nor necessarily in different files. But no strong feelings either way.

Change #1233708 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/WebAuthn@master] Delete more files/turn CI things off

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

I think the main outstanding things (patches still to be made) is to decide what we want to do about the i18n files going forward.

Do we want to merge the WebAuthn files into the OATHAuth ones? And if so, do we want to rename the message keys?

I don't think it's necessarily a bad thing for them to be different prefixed, nor necessarily in different files. But no strong feelings either way.

Historically we've moved the i18n over, then renamed a bit later, to make sure it doesn't break TWN.

In T303495#11557873, @Reedy hat geschrieben:

I think the main outstanding things (patches still to be made) is to decide what we want to do about the i18n files going forward.

Do we want to merge the WebAuthn files into the OATHAuth ones? And if so, do we want to rename the message keys?

I don't think it's necessarily a bad thing for them to be different prefixed, nor necessarily in different files. But no strong feelings either way.

A consistent prefix would have the advantage, that a wiki user could find all messages of this extension onwiki: https://de.wikipedia.org/wiki/Spezial:MediaWiki-Systemnachrichten?prefix=oath&filter=all&lang=de&limit=50

Different files are no problem.

In case of a prefix change please change en.json and qqq.json only. The rename of all translations would be done by translatewiki automatically during sync.

Change #1233686 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@master] Cleanup post merge of WebAuthn into OATHAuth

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

Change #1233687 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@master] i18n: Remove webauthn-desc message

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

Change #1233708 merged by jenkins-bot:

[mediawiki/extensions/WebAuthn@master] Delete more files/turn CI things off

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

Change #1233691 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@master] Re-namespace WebAuthn into OATHAuth

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

Change #1234502 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/OATHAuth@master] i18n: Rename webauthn messages to have common prefix with oathauth

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

Change #1234502 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@master] i18n: Rename webauthn messages to have common prefix with oathauth

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

Change #1237188 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/OATHAuth@master] HTMLForm: Fix double oathauth- prefix in sections

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

Change #1237188 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@master] HTMLForm: Fix double oathauth- prefix in sections

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

https://www.mediawiki.org/wiki/Extension:OATHAuth doesn't mention the requirement of gmp or bcmatch php extension that is mentioned in https://www.mediawiki.org/wiki/Extension:WebAuthn. Should it be added or is it outdated?

Change #1233679 merged by jenkins-bot:

[operations/mediawiki-config@master] CommonSettings.php: Stop loading WebAuthn

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

Change #1233680 merged by jenkins-bot:

[operations/mediawiki-config@master] wmf-config: Remove $wmgUseWebAuthn and extension from extension-list

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

Mentioned in SAL (#wikimedia-operations) [2026-02-17T12:29:23Z] <reedy@deploy2002> Started scap sync-world: Backport for [[gerrit:1233679|CommonSettings.php: Stop loading WebAuthn (T303495)]], [[gerrit:1233680|wmf-config: Remove $wmgUseWebAuthn and extension from extension-list (T303495)]]

Mentioned in SAL (#wikimedia-operations) [2026-02-17T12:33:54Z] <reedy@deploy2002> reedy: Backport for [[gerrit:1233679|CommonSettings.php: Stop loading WebAuthn (T303495)]], [[gerrit:1233680|wmf-config: Remove $wmgUseWebAuthn and extension from extension-list (T303495)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-02-17T12:40:21Z] <reedy@deploy2002> Finished scap sync-world: Backport for [[gerrit:1233679|CommonSettings.php: Stop loading WebAuthn (T303495)]], [[gerrit:1233680|wmf-config: Remove $wmgUseWebAuthn and extension from extension-list (T303495)]] (duration: 10m 58s)