{"record":{"id":"857a7791fa47055d","repo":"alibaba/spring-ai-alibaba","slug":"accountloginerror","errorCode":"AccountLoginError","errorMessage":"Login error, please check username and password.","messagePattern":"Login error, please check username and password\\.","errorType":"error_code","errorClass":"BizException","httpStatus":401,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/service/impl/AccountServiceImpl.java","lineNumber":100,"sourceCode":"\n\t/** workspace service */\n\tprivate final WorkspaceService workspaceService;\n\n\tprivate final ProviderManager providerManager;\n\n\t/** model manager */\n\tprivate final ModelManager modelManager;\n\n\t/**\n\t * Authenticates user and generates access tokens\n\t * @param loginRequest Login credentials\n\t * @return Token response containing access and refresh tokens\n\t */\n\t@Override\n\tpublic TokenResponse login(LoginRequest loginRequest) {\n\t\tAccountEntity accountEntity = getAccountByName(loginRequest.getUsername());\n\t\tif (accountEntity == null) {\n\t\t\tthrow new BizException(ErrorCode.ACCOUNT_LOGIN_ERROR.toError());\n\t\t}\n\n\t\tif (!PasswordCryptUtils.match(loginRequest.getPassword(), accountEntity.getPassword())) {\n\t\t\tthrow new BizException(ErrorCode.ACCOUNT_LOGIN_ERROR.toError());\n\t\t}\n\n\t\taccountEntity.setGmtLastLogin(new Date());\n\t\tthis.updateById(accountEntity);\n\n\t\t// cache it\n\t\tWorkspace workspace = workspaceService.getDefaultWorkspace(accountEntity.getAccountId());\n\t\tif (workspace == null) {\n\t\t\tthrow new BizException(ErrorCode.DEFAULT_WORKSPACE_NOT_FOUND.toError());\n\t\t}\n\n\t\taccountEntity.setDefaultWorkspaceId(workspace.getWorkspaceId());\n\t\tString key = getAccountCacheKey(accountEntity.getAccountId());\n\t\tredisManager.put(key, accountEntity);","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/service/impl/AccountServiceImpl.java#L82-L118","documentation":"Login failure in AccountServiceImpl.login: thrown as BizException(ACCOUNT_LOGIN_ERROR) when getAccountByName returns null (unknown username) or the supplied password does not match the stored credential. Deliberately generic to avoid revealing which credential was wrong.","triggerScenarios":"Thrown at spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/base/service/impl/AccountServiceImpl.java:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify username exists and password is correct","Check the password encoder/verification logic if all valid logins fail","Confirm the account is not in a deactivated state where lookup is skipped"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}