{"record":{"id":"73f0063692d6e706","repo":"apache/pulsar","slug":"deprecated-use-encodedauthenticationparametersupp","errorCode":null,"errorMessage":"Deprecated; use EncodedAuthenticationParameterSupport","messagePattern":"Deprecated; use EncodedAuthenticationParameterSupport","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/AuthenticationOAuth2.java","lineNumber":244,"sourceCode":"                percent = Double.parseDouble(value);\n            } else {\n                percent = Integer.parseInt(value) / 100.0;\n            }\n            if (percent <= 0) {\n                throw new IllegalArgumentException(\n                        CONFIG_PARAM_EARLY_TOKEN_REFRESH_PERCENT + \" must be greater than 0, got: \" + value);\n            }\n            return percent;\n        } catch (NumberFormatException e) {\n            throw new IllegalArgumentException(\n                    \"Malformed configuration parameter: \" + CONFIG_PARAM_EARLY_TOKEN_REFRESH_PERCENT, e);\n        }\n    }\n\n    @Override\n    @Deprecated\n    public void configure(Map<String, String> authParams) {\n        throw new NotImplementedException(\"Deprecated; use EncodedAuthenticationParameterSupport\");\n    }\n\n    @Override\n    public void start() throws PulsarClientException {\n        flow.initialize();\n    }\n\n    /**\n     * The first time that this method is called, it retrieves a token. All subsequent\n     * calls should get a cached value. However, if there is an issue with the Identity\n     * Provider, there is a chance that the background thread responsible for keeping\n     * the refresh token hot will\n     * @return The authentication data identifying this client that will be sent to the broker\n     * @throws PulsarClientException\n     */\n    @SuppressWarnings(\"deprecation\")\n    @Override\n    public synchronized AuthenticationDataProvider getAuthData() throws PulsarClientException {","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/AuthenticationOAuth2.java#L226-L262","documentation":"The legacy Map<String,String>-based configure() entry point of AuthenticationOAuth2 has been deprecated and intentionally stubbed. Any caller invoking it gets an immediate NotImplementedException telling them to migrate to EncodedAuthenticationParameterSupport, which supports URL-encoded authentication parameters.","triggerScenarios":"Calling authentication.configure(Map) directly; older client code or plugins wiring auth via the pre-2.x map-based Authentication API; frameworks that still invoke configure() reflectively.","commonSituations":"Upgrading Pulsar client versions where the deprecated method became a hard stub; copy-pasted custom Authentication implementations modeled on old samples.","solutions":["Implement EncodedAuthenticationParameterSupport and use configure(String encodedAuthParamString) instead","Pass auth parameters through the AuthenticationFactory or client builder rather than the deprecated map API","Update custom code that calls configure(Map) to the encoded-string variant"],"exampleFix":"// before\nauth.configure(authParamsMap);\n// after\nif (auth instanceof EncodedAuthenticationParameterSupport) {\n    ((EncodedAuthenticationParameterSupport) auth).configure(\"{\\\"issuerUrl\\\":\\\"...\\\",\\\"privateKey\\\":\\\"...\\\"}\");\n}","handlingStrategy":"try-catch","validationCode":"if (auth instanceof EncodedAuthenticationParameterSupport) {\n    ((EncodedAuthenticationParameterSupport) auth).configure(encodedParams);\n} else {\n    auth.configure(authParams); // legacy path only if still supported\n}","typeGuard":"boolean supportsEncodedParams(Authentication a) { return a instanceof EncodedAuthenticationParameterSupport; }","tryCatchPattern":"try {\n    auth.configure(authParams);\n} catch (NotImplementedException e) {\n    // migrate: use EncodedAuthenticationParameterSupport.configure(String)\n}","preventionTips":["Migrate all call sites to EncodedAuthenticationParameterSupport","Avoid calling deprecated configure(Map) in new code","Check AuthenticationFactory usage instead of manual configure calls"],"tags":["deprecated-api","oauth2","pulsar-client"],"backgroundTag":"deprecated-api-removed","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"}