{"record":{"id":"cf893b2e8b4afef5","repo":"NationalSecurityAgency/ghidra","slug":"unknown-authentication-method-options-are-tr","errorCode":null,"errorMessage":"Unknown authentication method: {} : options are trust, password or pki","messagePattern":"Unknown authentication method: (.+?) : options are trust, password or pki","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java","lineNumber":327,"sourceCode":"\t\t\t\t\tcertAuthorityFile = new File(value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase AUTH_OPTION:\n\t\t\t\t\tauthConfigPresent = true;\n\t\t\t\t\tString type = value;\n\t\t\t\t\tif (type.equals(\"pki\")) {\n\t\t\t\t\t\thostAuthentication = AUTHENTICATION_PKI;\n\t\t\t\t\t\tlocalAuthentication = AUTHENTICATION_PKI;\n\t\t\t\t\t}\n\t\t\t\t\telse if (type.equals(\"password\")) {\n\t\t\t\t\t\thostAuthentication = AUTHENTICATION_PASSWORD;\n\t\t\t\t\t\tlocalAuthentication = AUTHENTICATION_PASSWORD;\n\t\t\t\t\t}\n\t\t\t\t\telse if (type.equals(\"trust\") || type.equals(\"none\")) {\n\t\t\t\t\t\thostAuthentication = AUTHENTICATION_NONE;\n\t\t\t\t\t\tlocalAuthentication = AUTHENTICATION_NONE;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown authentication method: \" +\n\t\t\t\t\t\t\ttype + \" : options are trust, password or pki\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DN_OPTION:\n\t\t\t\t\tdistinguishedName = value;\n\t\t\t\t\tvalidateDistinguishedName();\n\t\t\t\t\tbreak;\n\t\t\t\tcase NO_LOCAL_AUTH_OPTION:\n\t\t\t\t\tsawNoLocalAuth = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase FORCE_OPTION:\n\t\t\t\t\tforceShutdown = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new AssertionError(\"Missing option handling: \" + option);\n\t\t\t}\n\t\t}\n","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimControlLaunchable.java#L309-L345","documentation":"Thrown in the AUTH_OPTION case when the --auth value is not one of 'trust', 'none', 'password', or 'pki'. These strings map to the internal AUTHENTICATION_NONE / AUTHENTICATION_PASSWORD / AUTHENTICATION_PKI constants used for both host and local connection authentication.","triggerScenarios":"Passing `--auth otp`, `--auth certificate`, or any value not matching the four accepted strings (line 327).","commonSituations":"Typo in the method name, expecting modern SSO/OAuth-style methods, or using a value copied from unrelated software docs.","solutions":["Use one of: trust, none (alias of trust), password, or pki.","Double-check spelling and case — matching is exact via String.equals.","Re-read the error message which lists the valid options."],"exampleFix":"// before\nbsim control configure host --auth certificate\n// after\nbsim control configure host --auth pki","handlingStrategy":"validation","validationCode":"// Constrain --auth to the accepted methods before launching.\nSet<String> auths = Set.of(\"trust\", \"none\", \"password\", \"pki\");\nif (!auths.contains(authValue)) {\n    System.err.println(\"Invalid --auth: \" + authValue + \". Choose: trust, password, pki\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    launchable.readOptions(command, params, discard);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unknown authentication method:\")) {\n        System.err.println(\"Use --auth trust|password|pki (none == trust).\");\n    }\n    throw e;\n}","preventionTips":["Validate the auth method against the fixed enum-like set up front.","Document that 'none' is an alias for 'trust'.","Reject invalid values with the accepted list rather than letting parsing fail."],"tags":["cli","argument-validation","security","authentication"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}