3 final class PhabricatorAuthManagementUntrustOAuthClientWorkflow
4 extends PhabricatorAuthManagementWorkflow
{
6 protected function didConstruct() {
8 ->setName('untrust-oauth-client')
9 ->setExamples('**untrust-oauth-client** [--id client_id]')
12 'Set Phabricator to not trust an OAuth client. Phabricator '.
13 'redirects to trusted OAuth clients that users have authorized '.
14 'without user intervention.'))
20 'help' => pht('The id of the OAuth client.'),
25 public function execute(PhutilArgumentParser
$args) {
26 $id = $args->getArg('id');
29 throw new PhutilArgumentUsageException(
31 'Specify an OAuth client ID with %s.',
35 $client = id(new PhabricatorOAuthServerClientQuery())
36 ->setViewer($this->getViewer())
41 throw new PhutilArgumentUsageException(
43 'Failed to find an OAuth client with ID %s.', $id));
46 if (!$client->getIsTrusted()) {
47 throw new PhutilArgumentUsageException(
49 'Phabricator already does not trust OAuth client "%s".',
53 $client->setIsTrusted(0);
56 $console = PhutilConsole
::getConsole();
60 'Updated; Phabricator does not trust OAuth client %s.',