{"record":{"id":"9c322a8632b68a08","repo":"Significant-Gravitas/AutoGPT","slug":"authorization-header-is-missing","errorCode":null,"errorMessage":"Authorization header is missing","messagePattern":"Authorization header is missing","errorType":"http","errorClass":"HTTPException","httpStatus":401,"severity":"error","filePath":"autogpt_platform/autogpt_libs/autogpt_libs/auth/jwt_utils.py","lineNumber":54,"sourceCode":"\n\nasync def get_jwt_payload(\n    credentials: HTTPAuthorizationCredentials | None = Security(bearer_jwt_auth),\n) -> dict[str, Any]:\n    \"\"\"\n    Extract and validate JWT payload from HTTP Authorization header.\n\n    This is the core authentication function that handles:\n    - Reading the `Authorization` header to obtain the JWT token\n    - Verifying the JWT token's signature\n    - Decoding the JWT token's payload\n\n    :param credentials: HTTP Authorization credentials from bearer token\n    :return: JWT payload dictionary\n    :raises HTTPException: 401 if authentication fails\n    \"\"\"\n    if not credentials:\n        raise HTTPException(status_code=401, detail=\"Authorization header is missing\")\n\n    try:\n        payload = await parse_jwt_token_async(credentials.credentials)\n        logger.debug(\"Token decoded successfully\")\n        return payload\n    except ValueError as e:\n        raise HTTPException(status_code=401, detail=str(e)) from e\n\n\nasync def parse_jwt_token_async(\n    token: str, audience: str = \"authenticated\"\n) -> dict[str, Any]:\n    \"\"\"Async wrapper around :func:`parse_jwt_token`.\n\n    On a JWKS cache miss the verification does a *synchronous* HTTP fetch\n    (PyJWKClient uses urllib). Awaiting that directly on the event loop stalls\n    every other request on the worker until it returns, not just this one — so\n    hand it to a thread. Cache hits are pure CPU and return immediately.","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/autogpt_libs/autogpt_libs/auth/jwt_utils.py#L36-L72","documentation":"Error \"Authorization header is missing\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/autogpt_libs/autogpt_libs/auth/jwt_utils.py:54 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include an 'Authorization: Bearer <token>' header in the request.","Ensure the client is signed in and the token is attached by the API client."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}