Open dominpm opened 5 days ago
Azure OAUTH failing due to bad request 400
uvicorn[756]: INFO: 10.0.12.185:0 - "GET /auth/oauth/azure-ad/callback?code=PLACEHOLDER HTTP/1.0" 500 Internal Server Error uvicorn[756]: ERROR: Exception in ASGI application uvicorn[756]: Traceback (most recent call last): uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi uvicorn[756]: result = await app( # type: ignore[func-returns-value] uvicorn[756]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call uvicorn[756]: return await self.app(scope, receive, send) uvicorn[756]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call uvicorn[756]: await super().call(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/applications.py", line 113, in call uvicorn[756]: await self.middleware_stack(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in call uvicorn[756]: raise exc uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in call uvicorn[756]: await self.app(scope, receive, _send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in call uvicorn[756]: await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app uvicorn[756]: raise exc uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app uvicorn[756]: await app(scope, receive, sender) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 715, in call uvicorn[756]: await self.middleware_stack(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 735, in app uvicorn[756]: await route.handle(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 460, in handle uvicorn[756]: await self.app(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call uvicorn[756]: await super().call(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/applications.py", line 113, in call uvicorn[756]: await self.middleware_stack(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in call uvicorn[756]: raise exc uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in call uvicorn[756]: await self.app(scope, receive, _send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in call uvicorn[756]: await self.app(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in call uvicorn[756]: await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app uvicorn[756]: raise exc uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app uvicorn[756]: await app(scope, receive, sender) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 715, in call uvicorn[756]: await self.middleware_stack(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 735, in app uvicorn[756]: await route.handle(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle uvicorn[756]: await self.app(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 76, in app uvicorn[756]: await wrap_app_handling_exceptions(app, request)(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app uvicorn[756]: raise exc uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app uvicorn[756]: await app(scope, receive, sender) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 73, in app uvicorn[756]: response = await f(request) uvicorn[756]: ^^^^^^^^^^^^^^^^ uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app uvicorn[756]: raw_response = await run_endpoint_function( uvicorn[756]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function uvicorn[756]: return await dependant.call(**values) uvicorn[756]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/chainlit/server.py", line 526, in oauth_callback uvicorn[756]: token = await provider.get_token(code, url) uvicorn[756]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/chainlit/oauth_providers.py", line 205, in get_token uvicorn[756]: response.raise_for_status() uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/httpx/_models.py", line 763, in raise_for_status uvicorn[756]: raise HTTPStatusError(message, request=request, response=self) uvicorn[756]: httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://login.microsoftonline.com/TENANT_PLACEHOLDER/oauth2/v2.0/token' uvicorn[756]: For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
Chainlit 1.3.2 Python 3.11.10
I didn't find any similar threads related to your specific issue with Azure OAUTH failing due to a bad request 400.
To continue talking to Dosu, mention @dosu.
Azure OAUTH failing due to bad request 400
uvicorn[756]: INFO: 10.0.12.185:0 - "GET /auth/oauth/azure-ad/callback?code=PLACEHOLDER HTTP/1.0" 500 Internal Server Error uvicorn[756]: ERROR: Exception in ASGI application uvicorn[756]: Traceback (most recent call last): uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi uvicorn[756]: result = await app( # type: ignore[func-returns-value] uvicorn[756]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call uvicorn[756]: return await self.app(scope, receive, send) uvicorn[756]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call uvicorn[756]: await super().call(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/applications.py", line 113, in call uvicorn[756]: await self.middleware_stack(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in call uvicorn[756]: raise exc uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in call uvicorn[756]: await self.app(scope, receive, _send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in call uvicorn[756]: await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app uvicorn[756]: raise exc uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app uvicorn[756]: await app(scope, receive, sender) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 715, in call uvicorn[756]: await self.middleware_stack(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 735, in app uvicorn[756]: await route.handle(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 460, in handle uvicorn[756]: await self.app(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call uvicorn[756]: await super().call(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/applications.py", line 113, in call uvicorn[756]: await self.middleware_stack(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in call uvicorn[756]: raise exc uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in call uvicorn[756]: await self.app(scope, receive, _send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in call uvicorn[756]: await self.app(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in call uvicorn[756]: await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app uvicorn[756]: raise exc uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app uvicorn[756]: await app(scope, receive, sender) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 715, in call uvicorn[756]: await self.middleware_stack(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 735, in app uvicorn[756]: await route.handle(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle uvicorn[756]: await self.app(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 76, in app uvicorn[756]: await wrap_app_handling_exceptions(app, request)(scope, receive, send) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app uvicorn[756]: raise exc uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app uvicorn[756]: await app(scope, receive, sender) uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/starlette/routing.py", line 73, in app uvicorn[756]: response = await f(request) uvicorn[756]: ^^^^^^^^^^^^^^^^ uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app uvicorn[756]: raw_response = await run_endpoint_function( uvicorn[756]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function uvicorn[756]: return await dependant.call(**values) uvicorn[756]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/chainlit/server.py", line 526, in oauth_callback uvicorn[756]: token = await provider.get_token(code, url) uvicorn[756]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/chainlit/oauth_providers.py", line 205, in get_token uvicorn[756]: response.raise_for_status() uvicorn[756]: File "/home/user/miniconda3/envs/chainlit/lib/python3.11/site-packages/httpx/_models.py", line 763, in raise_for_status uvicorn[756]: raise HTTPStatusError(message, request=request, response=self) uvicorn[756]: httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://login.microsoftonline.com/TENANT_PLACEHOLDER/oauth2/v2.0/token' uvicorn[756]: For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
Chainlit 1.3.2 Python 3.11.10