{"record":{"id":"3fa115607ee3e6a5","repo":"apache/pulsar","slug":"method-not-implemented","errorCode":null,"errorMessage":"Method not implemented!","messagePattern":"Method not implemented!","errorType":"exception","errorClass":"UnsupportedAuthenticationException","httpStatus":null,"severity":"error","filePath":"pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Authentication.java","lineNumber":53,"sourceCode":"@InterfaceStability.Stable\npublic interface Authentication extends Closeable, Serializable {\n\n    /**\n     * @return the identifier for this authentication method\n     */\n    String getAuthMethodName();\n\n    /**\n     *\n     * @return The authentication data identifying this client that will be sent to the broker\n     * @throws PulsarClientException.GettingAuthenticationDataException\n     *             if there was error getting the authentication data to use\n     * @throws PulsarClientException\n     *             any other error\n     */\n    @Deprecated\n    default AuthenticationDataProvider getAuthData() throws PulsarClientException {\n        throw new UnsupportedAuthenticationException(\"Method not implemented!\");\n    }\n\n    /**\n     * Get/Create an authentication data provider which provides the data that this client will be sent to the broker.\n     * Some authentication method need to auth between each client channel. So it need the broker, who it will talk to.\n     *\n     * @param brokerHostName\n     *          target broker host name\n     *\n     * @return The authentication data provider\n     */\n    default AuthenticationDataProvider getAuthData(String brokerHostName) throws PulsarClientException {\n        return this.getAuthData();\n    }\n\n    /**\n     * Configure the authentication plugins with the supplied parameters.\n     *","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Authentication.java#L35-L71","documentation":"Authentication.getAuthData() is a deprecated default interface method that intentionally throws UnsupportedAuthenticationException(\"Method not implemented!\") unless an authentication plugin overrides it. Newer plugins implement getAuthData(String brokerHostName) instead, so calling the deprecated no-arg form on such a plugin lands in the default body and always fails.","triggerScenarios":"Client or broker code calls auth.getAuthData() (the deprecated no-arg variant) on an Authentication plugin that only overrides getAuthData(String brokerHostName), e.g. custom or newer built-in plugins.","commonSituations":"Custom authentication code copied from old Pulsar examples calling the deprecated API; a plugin upgraded to the hostname-aware API while integration code still uses the old method.","solutions":["Call getAuthData(String brokerHostName) on the Authentication object instead of the deprecated no-arg getAuthData().","Update the custom Authentication plugin to override getAuthData(String brokerHostName).","Catch UnsupportedAuthenticationException and fall back to the hostname-aware method."],"exampleFix":"// before\nAuthenticationDataProvider data = authentication.getAuthData();\n// after\nAuthenticationDataProvider data = authentication.getAuthData(brokerHostName);","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    data = authentication.getAuthData();\n} catch (UnsupportedAuthenticationException e) {\n    data = authentication.getAuthData(brokerHostName);\n}","preventionTips":["Prefer getAuthData(String brokerHostName) over the deprecated no-arg method.","Ensure custom Authentication plugins override the hostname-aware getAuthData."],"tags":["pulsar","authentication","deprecated-api","unsupported-operation"],"backgroundTag":"method-not-implemented","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}