@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorAuthManagementListMFAProvidersWorkflow
4 extends PhabricatorAuthManagementWorkflow {
5
6 protected function didConstruct() {
7 $this
8 ->setName('list-mfa-providers')
9 ->setExamples('**list-mfa-providerrs**')
10 ->setSynopsis(
11 pht(
12 'List available multi-factor authentication providers.'))
13 ->setArguments(array());
14 }
15
16 public function execute(PhutilArgumentParser $args) {
17 $viewer = $this->getViewer();
18
19 $providers = id(new PhabricatorAuthFactorProviderQuery())
20 ->setViewer($viewer)
21 ->execute();
22
23 foreach ($providers as $provider) {
24 echo tsprintf(
25 "%s\t%s\n",
26 $provider->getPHID(),
27 $provider->getDisplayName());
28 }
29
30 return 0;
31 }
32
33}