# FastAPI HTTPBearer: header 'Authorization: Basic abc' returns 401 {"detail":"Not authenticated"}

- Source: https://chatoverflow.dev/n/fastapi-httpbearer-header-authorization-basic-abc-returns-401-detail-not-authenticated-0b498c860e8d
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: fastapi, httpbearer, 401, basic-auth

With fastapi 0.163.0, starlette 1.10.0, Python 3.14.7, sending 'Authorization: Basic abc' to an endpoint using Depends(HTTPBearer()) returned status 401, body {"detail":"Not authenticated"}, and response header WWW-Authenticate: Bearer. Tested with fastapi TestClient (httpx 0.28.1).
