{"record":{"id":"46b1bf52c560e3d8","repo":"paascloud/paascloud-master","slug":"clientid-46b1bf","errorCode":null,"errorMessage":"clientId对应的配置信息不存在:","messagePattern":"clientId对应的配置信息不存在:","errorType":"exception","errorClass":"UnapprovedClientAuthenticationException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/web/admin/UacUserLoginController.java","lineNumber":120,"sourceCode":"\tpublic Wrapper<String> refreshToken(HttpServletRequest request, @RequestParam(value = \"refreshToken\") String refreshToken, @RequestParam(value = \"accessToken\") String accessToken) {\n\t\tString token;\n\t\ttry {\n\t\t\tPreconditions.checkArgument(org.apache.commons.lang3.StringUtils.isNotEmpty(accessToken), \"accessToken is null\");\n\t\t\tPreconditions.checkArgument(org.apache.commons.lang3.StringUtils.isNotEmpty(refreshToken), \"refreshToken is null\");\n\t\t\tString header = request.getHeader(HttpHeaders.AUTHORIZATION);\n\t\t\tif (header == null || !header.startsWith(BEARER_TOKEN_TYPE)) {\n\t\t\t\tthrow new UnapprovedClientAuthenticationException(\"请求头中无client信息\");\n\t\t\t}\n\t\t\tString[] tokens = RequestUtil.extractAndDecodeHeader(header);\n\t\t\tassert tokens.length == 2;\n\n\t\t\tString clientId = tokens[0];\n\t\t\tString clientSecret = tokens[1];\n\n\t\t\tClientDetails clientDetails = clientDetailsService.loadClientByClientId(clientId);\n\n\t\t\tif (clientDetails == null) {\n\t\t\t\tthrow new UnapprovedClientAuthenticationException(\"clientId对应的配置信息不存在:\" + clientId);\n\t\t\t} else if (!StringUtils.equals(clientDetails.getClientSecret(), clientSecret)) {\n\t\t\t\tthrow new UnapprovedClientAuthenticationException(\"clientSecret不匹配:\" + clientId);\n\t\t\t}\n\n\t\t\ttoken = uacUserTokenService.refreshToken(accessToken, refreshToken, request);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"refreshToken={}\", e.getMessage(), e);\n\t\t\treturn WrapMapper.error();\n\t\t}\n\t\treturn WrapMapper.ok(token);\n\t}\n\n}","sourceCodeStart":102,"sourceCodeEnd":133,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/web/admin/UacUserLoginController.java#L102-L133","documentation":"UnapprovedClientAuthenticationException with message 'clientId对应的配置信息不存在:' + clientId thrown by UacUserLoginController.refreshToken when clientDetailsService.loadClientByClientId(clientId) returns null — the client id decoded from the Basic auth header has no registered OAuth2 ClientDetails record.","triggerScenarios":"POST to refreshToken with a Basic Authorization header whose decoded clientId does not exist in the OAuth client store (no row for that client_id in the client details table).","commonSituations":"Typo or case mismatch in the client id; client was deleted or not seeded in the target environment (DB not migrated); using a client id from another environment (dev client id against prod DB); database table oauth_client_details empty after a fresh install.","solutions":["Register the client id in the OAuth client details store (insert into oauth_client_details or the UAC client management UI)","Verify the clientId in the Basic auth header matches a registered client exactly (case-sensitive)","Seed the correct client configuration in the target environment's database","Check that clientDetailsService points at the right datasource/environment"],"exampleFix":"// before\nAuthorization: Basic d3JvbmdDbGllbnQ6c2VjcmV0  // 'wrongClient' not registered\n// after\nAuthorization: Basic cGFhc2Nsb3VkOnBhYXNjbG91ZA==  // registered clientId:secret","handlingStrategy":"validation","validationCode":"// confirm client is registered before calling\nconst registered = await fetchClientDetails(clientId); // or check oauth_client_details table\nif (!registered) { failFast('clientId not registered: ' + clientId); }","typeGuard":null,"tryCatchPattern":"try { await refreshToken(token, headers); }\ncatch (e) {\n  if (String(e.message).includes('配置信息不存在')) {\n    // register the client or fix the clientId in config\n  }\n}","preventionTips":["Keep client ids in environment-specific config, never hardcode","Seed oauth_client_details in every environment via migration scripts","Avoid typos: copy clientId from a single source of truth","Verify datasource points to the environment you expect"],"tags":["oauth2","client-registration","config"],"backgroundTag":"record-not-found","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}