{"record":{"id":"72210f06ac0bc63a","repo":"phacility/phabricator","slug":"specify-an-oauth-client-id-with-id","errorCode":null,"errorMessage":"Specify an OAuth client id with \"--id\".","messagePattern":"Specify an OAuth client id with \"--id\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/auth/management/PhabricatorAuthManagementTrustOAuthClientWorkflow.php","lineNumber":29,"sourceCode":"        pht(\n          'Mark an OAuth client as trusted. Trusted OAuth clients may be '.\n          'reauthorized without requiring users to manually confirm the '.\n          'action.'))\n      ->setArguments(\n        array(\n          array(\n            'name' => 'id',\n            'param' => 'id',\n            'help' => pht('The id of the OAuth client.'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $id = $args->getArg('id');\n\n    if (!$id) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify an OAuth client id with \"--id\".'));\n    }\n\n    $client = id(new PhabricatorOAuthServerClientQuery())\n      ->setViewer($this->getViewer())\n      ->withIDs(array($id))\n      ->executeOne();\n\n    if (!$client) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Failed to find an OAuth client with id %s.', $id));\n    }\n\n    if ($client->getIsTrusted()) {\n      throw new PhutilArgumentUsageException(\n        pht(","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/management/PhabricatorAuthManagementTrustOAuthClientWorkflow.php#L11-L47","documentation":"Usage guard in the OAuth trust CLI workflow: fires when the --id argument is empty/falsy, so there is no OAuth client to mark as trusted. The client id is a required singular argument; the check runs before any database lookup.","triggerScenarios":"Thrown at src/applications/auth/management/PhabricatorAuthManagementTrustOAuthClientWorkflow.php:29 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Find the client ID in the OAuth Clients application and pass it with --id","Run the workflow with --help to confirm the expected argument form"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","contentChangedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}