{
  "id": "python/fastapi-oauth2-missing-token",
  "signature": "fastapi.exceptions.HTTPException: 401 Unauthorized: {\"detail\":\"Not authenticated\"}",
  "signature_zh": "fastapi.exceptions.HTTPException: 401 未授权：未认证",
  "regex": "fastapi\\.exceptions\\.HTTPException:\\ 401\\ Unauthorized:\\ \\{\"detail\":\"Not\\ authenticated\"\\}",
  "domain": "python",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "OAuth2PasswordBearer dependency did not receive an Authorization: Bearer header, or the token was rejected.",
  "root_cause_type": "generic",
  "root_cause_zh": "OAuth2PasswordBearer依赖未收到Authorization: Bearer头，或token被拒绝。",
  "versions": [
    {
      "version": "0.100.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "0.110.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Returns None token and downstream logic still fails.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "OAuth2PasswordBearer expects the Authorization header by default.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "headers = {'Authorization': f'Bearer {token}'}\\nrequests.get(url, headers=headers)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "from fastapi.security import HTTPBearer\\nsecurity = HTTPBearer(auto_error=False)",
      "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": "2025-01-09",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}