{"record":{"id":"ec93614ec22331fe","repo":"infiniflow/ragflow","slug":"invalid-basic-auth-credentials","errorCode":null,"errorMessage":"Invalid Basic Auth credentials","messagePattern":"Invalid Basic Auth credentials","errorType":"exception","errorClass":"Exception","httpStatus":400,"severity":"error","filePath":"api/apps/restful_apis/agent_api.py","lineNumber":2034,"sourceCode":"    def _validate_token_auth(security_cfg):\n        \"\"\"Validate header-based token authentication.\"\"\"\n        token_cfg = security_cfg.get(\"token\", {})\n        header = token_cfg.get(\"token_header\")\n        token_value = token_cfg.get(\"token_value\")\n\n        provided = request.headers.get(header)\n        if provided != token_value:\n            raise Exception(\"Invalid token authentication\")\n\n    def _validate_basic_auth(security_cfg):\n        \"\"\"Validate HTTP Basic Auth credentials.\"\"\"\n        auth_cfg = security_cfg.get(\"basic_auth\", {})\n        username = auth_cfg.get(\"username\")\n        password = auth_cfg.get(\"password\")\n\n        auth = request.authorization\n        if not auth or auth.username != username or auth.password != password:\n            raise Exception(\"Invalid Basic Auth credentials\")\n\n    def _validate_jwt_auth(security_cfg):\n        \"\"\"Validate JWT token in Authorization header.\"\"\"\n        jwt_cfg = security_cfg.get(\"jwt\", {})\n        secret = jwt_cfg.get(\"secret\")\n        if not secret:\n            raise Exception(\"JWT secret not configured\")\n\n        auth_header = request.headers.get(\"Authorization\", \"\")\n        if not auth_header.startswith(\"Bearer \"):\n            raise Exception(\"Missing Bearer token\")\n\n        token = auth_header[len(\"Bearer \") :].strip()\n        if not token:\n            raise Exception(\"Empty Bearer token\")\n\n        alg = (jwt_cfg.get(\"algorithm\") or \"HS256\").upper()\n","sourceCodeStart":2016,"sourceCodeEnd":2052,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/api/apps/restful_apis/agent_api.py#L2016-L2052","documentation":"Error \"Invalid Basic Auth credentials\" thrown in infiniflow/ragflow.","triggerScenarios":"Thrown at api/apps/restful_apis/agent_api.py:2034 when the library encounters an invalid state.","commonSituations":"The webhook request presents incorrect Basic Auth credentials; updating the client credentials prevents this error.","solutions":["Send valid Basic Auth credentials matching the webhook configuration.","Verify the username/password have not been rotated."],"exampleFix":"import base64\nheaders = {'Authorization': 'Basic ' + base64.b64encode(b'user:pass').decode()}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}