{"record":{"id":"f9c00fa23c4aa498","repo":"alibaba/nacos","slug":"plugin-config-value-is-not-a-boolean-f9c00f","errorCode":null,"errorMessage":"Plugin config value is not a boolean: ","messagePattern":"Plugin config value is not a boolean: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"plugin-default-impl/nacos-oidc-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/oidc/config/OidcAuthPluginConfig.java","lineNumber":198,"sourceCode":"        return StringUtils.isBlank(result) ? defaultValue : result;\n    }\n    \n    private static long parsePositiveLong(String value, String key) {\n        try {\n            long result = Long.parseLong(value);\n            if (result <= 0) {\n                throw new IllegalArgumentException(\"Plugin config value must be positive: \" + key);\n            }\n            return result;\n        } catch (NumberFormatException e) {\n            throw new IllegalArgumentException(\"Plugin config value is not a number: \" + key, e);\n        }\n    }\n    \n    private static boolean parseBoolean(String value, String key) {\n        if (!Boolean.TRUE.toString().equalsIgnoreCase(value)\n            && !Boolean.FALSE.toString().equalsIgnoreCase(value)) {\n            throw new IllegalArgumentException(\"Plugin config value is not a boolean: \" + key);\n        }\n        return Boolean.parseBoolean(value);\n    }\n    \n    public boolean isValid() {\n        return StringUtils.isNotBlank(issuerUri) && StringUtils.isNotBlank(clientId);\n    }\n    \n    public boolean isJwtValidation() {\n        return DEFAULT_TOKEN_VALIDATION_METHOD.equalsIgnoreCase(tokenValidationMethod);\n    }\n    \n    public boolean isIntrospectionValidation() {\n        return \"introspection\".equalsIgnoreCase(tokenValidationMethod);\n    }\n    \n    public String getIssuerUri() {\n        return issuerUri;","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/plugin-default-impl/nacos-oidc-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/oidc/config/OidcAuthPluginConfig.java#L180-L216","documentation":"Thrown by parseBoolean() when a boolean config value (auto-create-user, strict-nonce-validation, or strict-audience-validation) is neither 'true' nor 'false' (case-insensitive). Any other string is rejected.","triggerScenarios":"Setting auto-create-user=yes, strict-nonce-validation=1, or strict-audience-validation=enabled.","commonSituations":"Operator uses yes/no, 1/0, enabled/disabled, or on/off instead of true/false; YAML implicit boolean coercion that yields a non-canonical token.","solutions":["Use exactly 'true' or 'false' (any case) for the offending key.","The appended key name identifies which of auto-create-user / strict-nonce-validation / strict-audience-validation is wrong."],"exampleFix":"// before\nnacos.plugin.auth.oidc.auto-create-user=yes\n// after\nnacos.plugin.auth.oidc.auto-create-user=true","handlingStrategy":"validation","validationCode":"// Pre-validate boolean config keys\nprivate static void assertBoolean(String key, String raw) {\n    if (!\"true\".equalsIgnoreCase(raw) && !\"false\".equalsIgnoreCase(raw)) {\n        throw new IllegalArgumentException(key + \" must be true/false, got: \" + raw);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    OidcAuthPluginConfig.from(configMap);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"is not a boolean\")) {\n        log.error(\"OIDC boolean config error: {}\", e.getMessage());\n    }\n}","preventionTips":["Use only 'true'/'false' for auto-create-user, strict-nonce-validation, strict-audience-validation.","Do not use yes/no, 1/0, enabled/disabled.","Validate config in a preflight check before applying."],"tags":["oidc","config","validation"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}