{"record":{"id":"60ff5949557670f5","repo":"alibaba/nacos","slug":"50002-60ff59","errorCode":"50002","errorMessage":"Empty identity, Please set `nacos.core.auth.server.identity.key` and `nacos.core.auth.server.identity.value`, detail: https://nacos.io/docs/latest/manual/admin/auth/","messagePattern":"Empty identity, Please set `nacos\\.core\\.auth\\.server\\.identity\\.key` and `nacos\\.core\\.auth\\.server\\.identity\\.value`, detail: https://nacos\\.io/docs/latest/manual/admin/auth/","errorType":"error_code","errorClass":"NacosRuntimeException","httpStatus":null,"severity":"critical","filePath":"core/src/main/java/com/alibaba/nacos/core/auth/NacosServerAuthConfig.java","lineNumber":73,"sourceCode":"    public NacosServerAuthConfig() {\n        super(\"NacosServerAuth\");\n        resetConfig();\n        validate();\n    }\n    \n    /**\n     * Validate auth config.\n     */\n    private void validate() {\n        if (!authEnabled) {\n            return;\n        }\n        if (StringUtils.isEmpty(nacosAuthSystemType)) {\n            throw new NacosRuntimeException(AuthErrorCode.INVALID_TYPE.getCode(),\n                AuthErrorCode.INVALID_TYPE.getMsg());\n        }\n        if (StringUtils.isEmpty(serverIdentityKey) || StringUtils.isEmpty(serverIdentityValue)) {\n            throw new NacosRuntimeException(AuthErrorCode.EMPTY_IDENTITY.getCode(),\n                AuthErrorCode.EMPTY_IDENTITY.getMsg());\n        }\n    }\n    \n    @Override\n    public String getAuthScope() {\n        return NACOS_SERVER_AUTH_SCOPE;\n    }\n    \n    /**\n     * server auth function is open.\n     *\n     * @return server auth function is open\n     */\n    @Override\n    public boolean isAuthEnabled() {\n        return authEnabled;\n    }","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/core/src/main/java/com/alibaba/nacos/core/auth/NacosServerAuthConfig.java#L55-L91","documentation":"Thrown by NacosServerAuthConfig.validate() (OPEN_API auth scope) when auth is enabled and type is set, but server identity key or value is empty. Identical logic to the admin-scope variant (1035) but for the OPEN_API scope. Error code 50002 (AuthErrorCode.EMPTY_IDENTITY). Both nacos.core.auth.server.identity.key and .value must be non-empty.","triggerScenarios":"Auth enabled with a type, but the server identity key/value pair is missing or partially set, validated by the OPEN_API-scope config. Applies to client/Open API auth scope. Thrown at config validation (startup or dynamic reset).","commonSituations":"Same as 1035: identity pair forgotten, only key or only value set, cluster nodes mismatched. Template/deployment artifact missing the identity lines.","solutions":["Set both nacos.core.auth.server.identity.key and nacos.core.auth.server.identity.value to non-empty identical values cluster-wide.","Use a strong unique secret, not the default.","Restart after applying the config."],"exampleFix":"# before (broken)\nnacos.core.auth.enabled=true\nnacos.plugin.auth.type=nacos\n# (no identity)\n\n# after (fixed)\nnacos.core.auth.enabled=true\nnacos.plugin.auth.type=nacos\nnacos.core.auth.server.identity.key=serverIdentity\nnacos.core.auth.server.identity.value=<strong-unique-secret>","handlingStrategy":"validation","validationCode":"# Same identity pre-flight as 1035\nif grep -q 'nacos.core.auth.enabled=true' application.properties; then\n  KEY=$(grep -oP 'nacos.core.auth.server.identity.key=\\K.*' application.properties)\n  VAL=$(grep -oP 'nacos.core.auth.server.identity.value=\\K.*' application.properties)\n  if [ -z \"$KEY\" ] || [ -z \"$VAL\" ]; then\n    echo 'ERROR: server identity key/value must both be set when auth is enabled'; exit 1;\n  fi\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set both identity key and value cluster-wide (covers OPEN_API scope).","Use a strong unique secret shared across nodes.","Add a deployment pre-flight check for the identity pair.","Avoid the default identity value in production."],"tags":["auth","config","java","startup","open-api","identity","security"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}