{"record":{"id":"dd116a94f071fa04","repo":"zaproxy/zaproxy","slug":"missing-parameter-dd116a","errorCode":"MISSING_PARAMETER","errorMessage":"MISSING_PARAMETER (loggedInIndicator)","messagePattern":"MISSING_PARAMETER \\(loggedInIndicator\\)","errorType":"error_code","errorClass":"ApiException","httpStatus":null,"severity":"error","filePath":"zap/src/main/java/org/zaproxy/zap/extension/authentication/VerificationAPI.java","lineNumber":144,"sourceCode":"                        getContext(params).getVerificationMethod().getLoggedOutIndicatorPattern();\n                return new ApiResponseElement(\n                        \"logged_out_regex\",\n                        loggedOutPattern != null ? loggedOutPattern.toString() : \"\");\n            default:\n                throw new ApiException(ApiException.Type.BAD_VIEW);\n        }\n    }\n\n    @Override\n    public ApiResponse handleApiAction(String name, JSONObject params) throws ApiException {\n        LOGGER.debug(\"handleApiAction {} {}\", name, params);\n\n        Context context;\n        switch (name) {\n            case ACTION_SET_LOGGED_IN_INDICATOR:\n                String loggedInIndicator = params.getString(PARAM_LOGGED_IN_INDICATOR);\n                if (loggedInIndicator == null || loggedInIndicator.isEmpty())\n                    throw new ApiException(Type.MISSING_PARAMETER, PARAM_LOGGED_IN_INDICATOR);\n                context = getContext(params);\n                context.getVerificationMethod().setLoggedInIndicatorPattern(loggedInIndicator);\n                context.save();\n                return ApiResponseElement.OK;\n\n            case ACTION_SET_LOGGED_OUT_INDICATOR:\n                String loggedOutIndicator = params.getString(PARAM_LOGGED_OUT_INDICATOR);\n                if (loggedOutIndicator == null || loggedOutIndicator.isEmpty())\n                    throw new ApiException(Type.MISSING_PARAMETER, PARAM_LOGGED_OUT_INDICATOR);\n                context = getContext(params);\n                context.getVerificationMethod().setLoggedOutIndicatorPattern(loggedOutIndicator);\n                context.save();\n                return ApiResponseElement.OK;\n\n            case ACTION_SET_VERIFICATION_METHOD:\n                context = getContext(params);\n                AuthCheckingStrategy strategy;\n                try {","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/zaproxy/zaproxy/blob/9d1970a436b1b189bfb588fc88864c80d9baf6a5/zap/src/main/java/org/zaproxy/zap/extension/authentication/VerificationAPI.java#L126-L162","documentation":"ApiException.Type.MISSING_PARAMETER with param name loggedInIndicator is thrown when the action setLoggedInIndicator is invoked without a non-empty loggedInIndicator parameter. VerificationAPI requires the regex string because an empty logged-in indicator is meaningless for session verification. JSONObject.getString returns null for absent keys here, triggering the guard.","triggerScenarios":"Calling action /JSON/auth/action/setLoggedInIndicator/ with the loggedInIndicator parameter omitted, sent as empty string, or sent with a JSON null value.","commonSituations":"Automation scripts that build the request dynamically and skip empty values; provisioning tools whose config has a blank 'loggedInIndicator' field; confusing this action with setLoggedOutIndicator and sending the wrong parameter name.","solutions":["Add a non-empty loggedInIndicator regex parameter, e.g. loggedInIndicator=.*Welcome,\\s+user.*","Verify the parameter key is exactly 'loggedInIndicator' (camelCase) in the query string or form body.","Check the source config/secret store for a blank value and populate it before calling the action.","Ensure your HTTP client is not dropping parameters with empty values from the query string."],"exampleFix":"// before: missing param\ncurl 'http://zap/JSON/auth/action/setLoggedInIndicator/?contextId=1'\n// after\ncurl 'http://zap/JSON/auth/action/setLoggedInIndicator/?contextId=1&loggedInIndicator=.*Logout.*'","handlingStrategy":"validation","validationCode":"if (!params.loggedInIndicator || params.loggedInIndicator.trim() === \"\") {\n  throw new Error(\"loggedInIndicator is required and must be a non-empty regex\");\n}","typeGuard":"function isNonEmptyString(v) {\n  return typeof v === \"string\" && v.length > 0;\n}","tryCatchPattern":"try {\n  await zapApi.action(\"setLoggedInIndicator\", params);\n} catch (e) {\n  if (e.code === \"MISSING_PARAMETER\" && e.detail === \"loggedInIndicator\") {\n    throw new Error(\"Provide a non-empty loggedInIndicator regex for setLoggedInIndicator\");\n  }\n  throw e;\n}","preventionTips":["Validate required regex fields before dispatching API calls.","Use named constants for parameter keys to avoid typos like loggedoutIndicator.","Fail fast in config loading when authentication indicator fields are blank."],"tags":["zap-api","missing-parameter","validation","authentication"],"backgroundTag":"missing-required-argument","analyzedSha":"9d1970a436b1b189bfb588fc88864c80d9baf6a5","analyzedAt":"2026-09-05T19:26:59.356Z","contentChangedAt":"2026-09-05T19:26:59.356Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}