I tried to run the example from https://authx.yezz.me/get-started/basic-usage/ and got an error:
INFO: 127.0.0.1:18932 - "GET /login?username=test&password=test HTTP/1.1" 200 OK
INFO: 127.0.0.1:18980 - "GET /protected HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 409, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\fastapi\applications.py", line 1054, in __call__
await super().__call__(scope, receive, send)
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\applications.py", line 113, in __call__
await self.middleware_stack(scope, receive, send)
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\middleware\errors.py", line 187, in __call__
raise exc
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\middleware\errors.py", line 165, in __call__
await self.app(scope, receive, _send)
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in __call__
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
raise exc
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\routing.py", line 715, in __call__
await self.middleware_stack(scope, receive, send)
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\routing.py", line 735, in app
await route.handle(scope, receive, send)
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\routing.py", line 288, in handle
await self.app(scope, receive, send)
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\routing.py", line 76, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
raise exc
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\starlette\routing.py", line 73, in app
response = await f(request)
^^^^^^^^^^^^^^^^
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\fastapi\routing.py", line 291, in app
solved_result = await solve_dependencies(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\fastapi\dependencies\utils.py", line 638, in solve_dependencies
solved = await call(**solved_result.values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\authx\main.py", line 619, in _auth_required
return await self._auth_required(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\authx\main.py", line 351, in _auth_required
request_token = await method(
^^^^^^^^^^^^^
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\authx\main.py", line 308, in get_access_token_from_request
return await self._get_token_from_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\authx\main.py", line 281, in _get_token_from_request
return await _get_token_from_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\nawas\PycharmProjects\fastapi_playground\.venv\Lib\site-packages\authx\core.py", line 156, in _get_token_from_request
raise MissingTokenError(*(str(err) for err in errors))
authx.exceptions.MissingTokenError: Missing 'Bearer' in 'Authorization' header.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too