You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this package!
I tried setting up FastAPI with AzureAD for days, and used many packages.
But only using this package, combined with starlette-authlib (encode/starlette#2019 (comment)) resulted in the expected behavior.
However, as it is, I am encountering a crash with this traceback:
File "/py/lib/python3.11/site-packages/fastapi_msal/auth.py", line 66, in _login_route
return await self.handler.authorize_redirect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/py/lib/python3.11/site-packages/fastapi_msal/security/msal_auth_code_handler.py", line 26, in authorize_redirect
auth_code: AuthCode = await self.msal_app().initiate_auth_flow(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/py/lib/python3.11/site-packages/fastapi_msal/clients/async_conf_client.py", line 95, in initiate_auth_flow
return AuthCode.parse_obj_debug(to_parse=auth_code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/py/lib/python3.11/site-packages/fastapi_msal/models/base_auth_model.py", line 13, in parse_obj_debug
debug_model: AuthModel = cls.parse_obj(obj=to_parse)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for AuthCode
redirect_uri
str type expected (type=type_error.str)
So as a workaround, I put this line in my Dockerfile and now it works:
RUN sed -i "s/redirec_uri=redirect_uri/redirec_uri=str(redirect_uri)/" /py/lib/python3.11/site-packages/fastapi_msal/auth.py
BTW: In some places over there, it says redirec instead of redirect.
Thanks again.
The text was updated successfully, but these errors were encountered:
Hey, I came across the same error and created a fix for it. It is backwards compatible and only a small change in the code. Can you please check it @dudil? Thanks a lot for your work!
Hi @reastyn - I've update the package on PyPi it is version 1.8.1
I Had to add other changes since I was also changing the publish scripts and the backend to Hatch.
So please make sure you are checking that through - this release might not work since all the base packages had change since then.
Thank you for this package!
I tried setting up FastAPI with AzureAD for days, and used many packages.
But only using this package, combined with starlette-authlib (encode/starlette#2019 (comment)) resulted in the expected behavior.
However, as it is, I am encountering a crash with this traceback:
So as a workaround, I put this line in my Dockerfile and now it works:
BTW: In some places over there, it says
redirec
instead ofredirect
.Thanks again.
The text was updated successfully, but these errors were encountered: