{"record":{"id":"67f097d6748e59b6","repo":"NationalSecurityAgency/ghidra","slug":"no-registered-authenticator","errorCode":null,"errorMessage":"No registered authenticator","messagePattern":"No registered authenticator","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimPostgresDBConnectionManager.java","lineNumber":336,"sourceCode":"\t\t\t\t\tconnectionType = ConnectionType.Unencrypted_No_Authentication;\n\t\t\t\t\tbds.removeConnectionProperty(\"sslmode\");\n\t\t\t\t\tbds.removeConnectionProperty(\"sslfactory\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tMsg.debug(this, serverInfo + \" getConnection: active=\" + bds.getNumActive() +\n\t\t\t\t\t\" idle=\" + bds.getNumIdle());\n\t\t\t}\n\n\t\t\twhile (true) {\n\t\t\t\tClientAuthenticator clientAuthenticator = null;\n\t\t\t\tif (connectionType == ConnectionType.SSL_Password_Authentication) {\n\t\t\t\t\tclientAuthenticator = ClientUtil.getClientAuthenticator();\n\t\t\t\t\tif (clientAuthenticator == null) { // Make sure authenticator is registered\n\t\t\t\t\t\tthrow new SQLException(\"No registered authenticator\");\n\t\t\t\t\t}\n\t\t\t\t\tNameCallback nameCb = new NameCallback(\"User ID:\", bds.getUsername());\n\t\t\t\t\tboolean allowUserIDEntry = true;\n\t\t\t\t\tif (!serverInfo.hasDefaultLogin()) {\n\t\t\t\t\t\tnameCb.setName(bds.getUsername());\n\t\t\t\t\t\tallowUserIDEntry = false;\n\t\t\t\t\t}\n\t\t\t\t\tPasswordCallback passCb = new PasswordCallback(\" \", false); // force use of default prompting\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!clientAuthenticator.processPasswordCallbacks(\n\t\t\t\t\t\t\t\"BSim Database Authentication\", \"BSim DB Server\", serverInfo.toString(),\n\t\t\t\t\t\t\tallowUserIDEntry, nameCb, passCb, null, null, loginError)) {\n\t\t\t\t\t\t\tthrow new CancelledException();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbds.setPassword(new String(passCb.getPassword()));\n\t\t\t\t\t\t// User may have specified new username, or this may return NULL\n\t\t\t\t\t\tif (serverInfo.hasDefaultLogin()) {\n\t\t\t\t\t\t\tbds.setUsername(nameCb.getName());","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/BSimPostgresDBConnectionManager.java#L318-L354","documentation":"Thrown by BSimPostgresDBConnectionManager when the connection type is SSL_Password_Authentication but ClientUtil.getClientAuthenticator() returns null. SSL password authentication routes credential prompting through a registered ClientAuthenticator (normally installed by the Ghidra GUI layer); if none is registered, the connection cannot solicit credentials and throws SQLException.","triggerScenarios":"Opening an SSL password-authenticated BSim PostgreSQL connection in a context where no ClientAuthenticator has been registered with ClientUtil (e.g., a headless or non-Ghidra-framework caller).","commonSituations":"Running BSim queries from a headless script or test harness that did not initialize the Ghidra client authentication layer; integrating BSim into a custom application without registering an authenticator.","solutions":["Register a ClientAuthenticator via ClientUtil before connecting, e.g. ClientUtil.setClientAuthenticator(new YourAuthenticator()).","If running under the Ghidra GUI, ensure the application is properly initialized so the default authenticator is installed.","For headless use, implement a ClientAuthenticator that supplies credentials programmatically."],"exampleFix":"// before (no authenticator registered for SSL password auth)\nConnection c = dbConnectionManager.getConnection(sslServerInfo); // SQLException\n// after (register an authenticator first)\nClientUtil.setClientAuthenticator(myHeadlessAuthenticator);\nConnection c = dbConnectionManager.getConnection(sslServerInfo);","handlingStrategy":"validation","validationCode":"if (connectionType == ConnectionType.SSL_Password_Authentication && ClientUtil.getClientAuthenticator() == null) {\n    throw new IllegalStateException(\"No ClientAuthenticator registered; register one before SSL password auth\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    Connection c = dbConnectionManager.getConnection(sslServerInfo);\n} catch (SQLException e) {\n    if (\"No registered authenticator\".equals(e.getMessage())) {\n        ClientUtil.setClientAuthenticator(myAuthenticator);\n        Connection c = dbConnectionManager.getConnection(sslServerInfo);\n    } else {\n        throw e;\n    }\n}","preventionTips":["Register a ClientAuthenticator via ClientUtil before any SSL password connection attempt.","In headless tools, install a programmatic authenticator during initialization.","Guard connection setup with a null check on ClientUtil.getClientAuthenticator()."],"tags":["bsim","postgres","ssl","authentication","configuration"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}