{"record":{"id":"4d2e56aa9ba3d286","repo":"alibaba/nacos","slug":"50002","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/NacosServerAdminAuthConfig.java","lineNumber":73,"sourceCode":"    public NacosServerAdminAuthConfig() {\n        super(\"NacosServerAdminAuth\");\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_ADMIN_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/NacosServerAdminAuthConfig.java#L55-L91","documentation":"Thrown by NacosServerAdminAuthConfig.validate() (ADMIN_API auth scope) when auth is enabled and the auth type is set, but the server identity key or value is empty. The server identity (nacos.core.auth.server.identity.key / .value) is a shared secret used for inter-server trust bypass. Error code 50002 (AuthErrorCode.EMPTY_IDENTITY). Both key and value must be non-empty; either missing triggers this.","triggerScenarios":"Auth enabled with a valid type, but nacos.core.auth.server.identity.key or nacos.core.auth.server.identity.value is unset/empty in application.properties. Applies to the admin API auth scope. Thrown at config validation (startup or dynamic reset).","commonSituations":"Operator sets auth.type but forgets the identity pair. Only the key is set (value empty) or vice versa. Cluster nodes with mismatched identity configs. Fresh deployment copying a partial config template.","solutions":["Set both nacos.core.auth.server.identity.key and nacos.core.auth.server.identity.value to non-empty, identical values on every cluster node.","Use a strong, unique shared secret for the value (not the default 'security').","Ensure all nodes in the cluster share the same identity pair.","Restart the server after setting the properties."],"exampleFix":"# before (broken)\nnacos.core.auth.enabled=true\nnacos.plugin.auth.type=nacos\n# (no identity set)\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":"# Shell pre-flight check\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 nacos.core.auth.server.identity.key and .value to non-empty identical values on every node.","Use a strong unique secret, not the default 'security'.","Distribute the identity pair consistently across the cluster.","Add a deployment pre-flight check for the identity pair."],"tags":["auth","config","java","startup","admin-api","identity","security"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}