{"record":{"id":"1cb75fe57be50e98","repo":"apache/pulsar","slug":"no-authentication-parameters-were-provided","errorCode":null,"errorMessage":"No authentication parameters were provided","messagePattern":"No authentication parameters were provided","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/AuthenticationOAuth2.java","lineNumber":191,"sourceCode":"        if (TYPE_CLIENT_CREDENTIALS.equals(type)) {\n            TokenEndpointAuthMethod authMethod = TokenEndpointAuthMethod.fromValue(\n                    params.getOrDefault(CONFIG_PARAM_TOKEN_ENDPOINT_AUTH_METHOD,\n                            TokenEndpointAuthMethod.CLIENT_SECRET_POST.value()));\n            if (authMethod == TokenEndpointAuthMethod.CLIENT_SECRET_POST) {\n                this.flow = ClientCredentialsFlow.fromParameters(params);\n            } else if (authMethod == TokenEndpointAuthMethod.TLS_CLIENT_AUTH) {\n                this.flow = TlsClientAuthFlow.fromParameters(params);\n            } else {\n                throw new IllegalArgumentException(\"Unsupported auth method: \" + authMethod);\n            }\n        } else {\n            throw new IllegalArgumentException(\"Unsupported authentication type: \" + type);\n        }\n    }\n\n    protected Map<String, String> parseAuthParameters(String encodedAuthParamString) {\n        if (StringUtils.isBlank(encodedAuthParamString)) {\n            throw new IllegalArgumentException(\"No authentication parameters were provided\");\n        }\n        Map<String, String> params;\n        try {\n            params = AuthenticationUtil.configureFromJsonString(encodedAuthParamString);\n        } catch (IOException e) {\n            throw new IllegalArgumentException(\"Malformed authentication parameters\", e);\n        }\n\n        String earlyRefreshPercentStr = params.get(CONFIG_PARAM_EARLY_TOKEN_REFRESH_PERCENT);\n        if (earlyRefreshPercentStr != null) {\n            double percent = parseEarlyRefreshPercent(earlyRefreshPercentStr);\n            this.earlyTokenRefreshPercent = percent;\n            if (percent < 1 && this.scheduler == null) {\n                this.scheduler = INTERNAL_SCHEDULER;\n            }\n        }\n        return params;\n    }","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/AuthenticationOAuth2.java#L173-L209","documentation":"AuthenticationOAuth2.parseAuthParameters() rejects a null, empty, or whitespace-only auth params string up front, throwing this IllegalArgumentException. The OAuth2 plugin cannot be configured without at least issuer/client credentials, so blank input is treated as a programming/config error rather than ignored.","triggerScenarios":"Calling configure(\"\") or configure(null); passing a config value read from an unset environment variable or empty property into configure().","commonSituations":"Auth params sourced from PULSAR_AUTH_PARAMS env var that was never set; a YAML/properties placeholder left unfilled; concatenating params where the OAuth2 section is empty.","solutions":["Provide a non-blank auth params JSON string, e.g. {\"type\":\"oauth2\",\"issuerUrl\":\"...\",\"clientId\":\"...\",\"clientSecret\":\"...\"}.","Fix the env var/property feeding the params value.","Only call configure() when params are actually present; use the default constructor + factory otherwise."],"exampleFix":"// before\nString params = System.getenv(\"PULSAR_AUTH_PARAMS\"); // null\nauth.configure(params); // throws\n// after\nString params = System.getenv(\"PULSAR_AUTH_PARAMS\");\nif (params != null && !params.isBlank()) {\n    auth.configure(params);\n}","handlingStrategy":"validation","validationCode":"if (paramsJson == null || paramsJson.isBlank()) {\n    throw new IllegalStateException(\"OAuth2 auth params must be provided (non-blank JSON)\");\n}\nauth.configure(paramsJson);","typeGuard":null,"tryCatchPattern":"try {\n    auth.configure(paramsJson);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"No authentication parameters\")) {\n        log.error(\"Auth params string is blank; check PULSAR_AUTH_PARAMS/config source\");\n        throw new ConfigurationException(\"Missing OAuth2 auth parameters\", e);\n    }\n    throw e;\n}","preventionTips":["Check the env var or property feeding auth params is set before calling configure().","Fail fast at startup with a clear message when params are blank.","Keep the params string in one constant/template to avoid accidental empty concatenation."],"tags":["pulsar-client","oauth2","authentication","configuration"],"backgroundTag":"missing-config-parameter","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}