paascloud/paascloud-master · error · UacBizException

UAC10011035

UAC10011035

Error message

ErrorCodeEnum.UAC10011035

What it means

UAC10011035 is thrown by UacUserServiceImpl.userModifyPwd when the supplied oldPassword does not match the stored MD5-hashed login password (Md5Util.matches(oldPassword, oldPwd) returns false). The user is authenticated by loginName but fails the old-password verification step required to change a password.

Solutions

  1. Have the user re-enter the correct current password
  2. Verify the client sends the plaintext old password (service hashes it internally with Md5Util.matches)
  3. If the password is forgotten, use the reset-password flow (resetLoginPwd / mobile reset) instead of modify-pwd
  4. Catch UacBizException code UAC10011035 and prompt 'old password incorrect'

Example fix

// before
// client pre-hashes
String old = Md5Util.encrypt(rawOldPwd);
uacUserService.userModifyPwd(loginName, old, newPwd, confirmPwd);
// after
uacUserService.userModifyPwd(loginName, rawOldPwd, newPwd, confirmPwd);
Defensive patterns

Strategy: try-catch

Try / catch

try { uacUserService.userModifyPwd(loginName, oldPwd, newPwd, confirmPwd); } catch (UacBizException e) { if ("UAC10011035".equals(e.getCode())) { /* prompt: old password incorrect */ } }

Prevention

When it happens

Trigger: Calling userModifyPwd(loginName, oldPassword, newPassword, confirmNewPassword) where oldPassword is wrong, was typed incorrectly, or does not correspond to the current stored password hash.

Common situations: User forgot current password; password was changed elsewhere (another session/device) so the remembered old password is stale; client sends an already-hashed password while the service expects plaintext; caps-lock/whitespace issues in input.

Related errors


AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10). Data as JSON: /api/errors/e36069a7cbb36535. Report an issue: GitHub.

Appendix: source

Thrown at paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java:457

		String confirmPwd = userModifyPwdDto.getConfirmPwd();

		Preconditions.checkArgument(!PublicUtil.isEmpty(loginName), ErrorCodeEnum.UAC10011007.msg());
		Preconditions.checkArgument(!PublicUtil.isEmpty(oldPassword), "原始密码不能为空");
		Preconditions.checkArgument(!PublicUtil.isEmpty(newPassword), "新密码不能为空");
		Preconditions.checkArgument(!PublicUtil.isEmpty(confirmPwd), ErrorCodeEnum.UAC10011009.msg());
		Preconditions.checkArgument(newPassword.equals(confirmPwd), "两次密码不一致, 请重新输入!");


		UacUser user = uacUserMapper.findByLoginName(loginName);
		if (PublicUtil.isEmpty(user)) {
			throw new UacBizException(ErrorCodeEnum.UAC10011002, loginName);
		}

		String oldPwd = user.getLoginPwd();
		String newEncrypt = Md5Util.encrypt(newPassword);

		if (!Md5Util.matches(oldPassword, oldPwd)) {
			throw new UacBizException(ErrorCodeEnum.UAC10011035);
		}

		UacUser uacUser = new UacUser();
		if (Md5Util.matches(newPassword, oldPwd)) {
			throw new UacBizException(ErrorCodeEnum.UAC10011036);
		}

		uacUser.setLoginPwd(Md5Util.encrypt(newPassword));
		uacUser.setId(user.getId());
		uacUser.setLoginPwd(newEncrypt);
		// 该用户已经修改过密码
		uacUser.setIsChangedPwd(Short.valueOf("1"));
		uacUser.setUpdateInfo(authResDto);

		return uacUserMapper.updateByPrimaryKeySelective(uacUser);

		// TODO 发送重置密码成功的邮件
	}

View on GitHub (pinned to 781281a950)