Page MenuHomePhabricator

Parser function for checking if OATHAuth is enabled
Closed, DeclinedPublicFeature

Description

Feature summary: I think that it would be useful to have a way to check whether OathAuth is enabled using a parser function (even better: provide a global variable to force it in a simpler way).

Use case(s): just as an example, I upload a patch based on the current version (13.01.2023) containing a possible implementation. Feel free to integrate my code if you find it functional.

Benefits: with such a parser function, admins would be able to force users to set up a 2FA additional control.

Event Timeline

Benefits: with such a parser function, admins would be able to force users to set up a 2FA additional control.

I don't understand how a parserfunction does this?

Reedy renamed this task from Parser function for checking if OathAuth is enabled to Parser function for checking if OATHAuth is enabled.Jan 31 2023, 8:35 PM
Reedy updated the task description. (Show Details)

Benefits: with such a parser function, admins would be able to force users to set up a 2FA additional control.

I don't understand how a parserfunction does this?

For example, I use this code in MediaWiki:Mainpage of one of my (internal) wikis, assuming that the parser function is named checkOath:

{{#ifeq: {{#checkOath:}} | 1
| Pagina principale
| Special:Oath
}}

However, it would be better and also safer to be able to just set a global variable to enforce 2FA.

See: T150562: Be able to force OATHAuth for certain user groups.

I just noticed it's not documented on https://www.mediawiki.org/wiki/Extension:OATHAuth which is unhelpful. Will either fix that myself, or file a task to get it fixed.

Reedy triaged this task as Low priority.Dec 6 2023, 12:47 PM
taavi subscribed.

This would require splitting the parser cache per-user, let's not do that. For requiring 2-factor authentication for some users there are surely better mechanisms for that such as wgOATHRequiredForGroups.