{
  "id": "python/fastapi-oauth2-token-missing",
  "signature": "fastapi.exceptions.HTTPException: 401 Unauthorized: {\"detail\":\"Not authenticated\"}",
  "signature_zh": "fastapi.exceptions.HTTPException: 401 未授权：{\"detail\":\"未认证\"}",
  "regex": "fastapi\\.exceptions\\.HTTPException:\\ 401\\ Unauthorized:\\ \\{\"detail\":\"Not\\ authenticated\"\\}",
  "domain": "python",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "The Authorization header was missing or malformed, so the OAuth2PasswordBearer dependency rejected the request before reaching the route.",
  "root_cause_type": "generic",
  "root_cause_zh": "Authorization 头缺失或格式错误，导致 OAuth2PasswordBearer 依赖在到达路由前拒绝了请求。",
  "versions": [
    {
      "version": "0.100+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Route then receives None token and crashes on decode.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Auth bypass ships to production; security hole.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "fetch('/me', {headers: {'Authorization': `Bearer ${token}`}})",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "def get_token(request: Request):\n    return request.cookies.get('access_token')",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-28",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}