{"record":{"id":"ae4485b2d6f287da","repo":"alibaba/nacos","slug":"user-not-found-please-check-user-exist-or-passwor","errorCode":null,"errorMessage":"User not found! Please check user exist or password is right!","messagePattern":"User not found! Please check user exist or password is right!","errorType":"exception","errorClass":"AccessException","httpStatus":null,"severity":"error","filePath":"plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/authenticate/AbstractAuthenticationManager.java","lineNumber":61,"sourceCode":"    \n    protected NacosUserService userDetailsService;\n    \n    protected TokenManagerDelegate jwtTokenManager;\n    \n    protected NacosRoleService roleService;\n    \n    public AbstractAuthenticationManager(NacosUserService userDetailsService,\n        TokenManagerDelegate jwtTokenManager,\n        NacosRoleService roleService) {\n        this.userDetailsService = userDetailsService;\n        this.jwtTokenManager = jwtTokenManager;\n        this.roleService = roleService;\n    }\n    \n    @Override\n    public NacosUser authenticate(String username, String rawPassword) throws AccessException {\n        if (StringUtils.isBlank(username) || StringUtils.isBlank(rawPassword)) {\n            throw new AccessException(USER_NOT_FOUND_MESSAGE);\n        }\n        NacosUserDetails nacosUserDetails =\n            (NacosUserDetails) userDetailsService.loadUserByUsername(username);\n        if (nacosUserDetails == null\n            || !PasswordEncoderUtil.matches(rawPassword, nacosUserDetails.getPassword())) {\n            throw new AccessException(USER_NOT_FOUND_MESSAGE);\n        }\n        return new NacosUser(nacosUserDetails.getUsername(), jwtTokenManager.createToken(username));\n    }\n    \n    @Override\n    public NacosUser authenticate(String token) throws AccessException {\n        if (StringUtils.isBlank(token)) {\n            throw new AccessException(USER_NOT_FOUND_MESSAGE);\n        }\n        return jwtTokenManager.parseToken(token);\n    }\n    ","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/plugin-default-impl/nacos-default-auth-plugin/src/main/java/com/alibaba/nacos/plugin/auth/impl/authenticate/AbstractAuthenticationManager.java#L43-L79","documentation":"Thrown by AbstractAuthenticationManager.authenticate(username, rawPassword) when EITHER username OR rawPassword is blank. It raises AccessException with the shared USER_NOT_FOUND_MESSAGE constant. This is the blank-input guard distinct from the credential-mismatch guard at line 67.","triggerScenarios":"Calling authenticate(username, password) where username is empty/null or password is empty/null. Reached via the username/password login path (login API, SDK auth, or internal authenticate calls).","commonSituations":"Clients sending an empty password when none was configured; misconfigured SDK credential properties; programmatic login with null variables due to upstream config loading failure.","solutions":["Ensure both username and password are non-blank before calling authenticate (validate at the caller).","Check SDK config: nacos.core.auth.* username/password properties must be set when auth is enabled.","If using env vars, verify they are exported and non-empty in the runtime environment."],"exampleFix":"// before\nmanager.authenticate(user, null); // blank password -> AccessException\n\n// after\nif (StringUtils.isBlank(user) || StringUtils.isBlank(pass)) {\n    throw new IllegalArgumentException(\"username and password are required\");\n}\nmanager.authenticate(user, pass);","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(username) || StringUtils.isBlank(rawPassword)) {\n    throw new IllegalArgumentException(\"username and password are required\");\n}\nmanager.authenticate(username, rawPassword);","typeGuard":"static boolean hasCredentials(String u, String p) {\n    return StringUtils.isNotBlank(u) && StringUtils.isNotBlank(p);\n}","tryCatchPattern":null,"preventionTips":["Validate credentials are non-blank before calling authenticate.","Ensure SDK auth config properties are set when auth is enabled.","Fail fast in clients on missing env-supplied credentials."],"tags":["auth","authentication","blank-input","access-exception"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}