fastapi docs are outdated.
Hello, I'm trying to configure a fast-api as documented but it seems to miss a few steps . https://docs.kinde.com/developer-tools/sdks/backend/python-sdk/
1) I get KindeConfigurationException: Client ID is required. when I do fastapi run dev --port 5000. It's fixable with load_env
2) Then, when I hit /login I get "AssertionError: SessionMiddleware must be installed to access request.session" and this is where I'm stuck.
Kinde docs
Python SDK
Complete guide for Python SDK including Flask and FastAPI integration, OAuth configuration, environment variables, and session management for Python 3.9+ applications.
3 Replies
Hi there,
Thanks for reaching out. You're encountering two common FastAPI setup issues. The first issue about the Client ID is resolved by loading environment variables, as you mentioned.
For the SessionMiddleware error, you need to add session middleware to your FastAPI app. The SessionMiddleware addition comes from FastAPI/Starlette requirements. The Kinde SDK expects session functionality to be available. Please let me know if you have further questions.
For the SessionMiddleware error, you need to add session middleware to your FastAPI app. The SessionMiddleware addition comes from FastAPI/Starlette requirements. The Kinde SDK expects session functionality to be available. Please let me know if you have further questions.
That’s right, I found an example that shows it . The point was that the docs (official) are not clear
Hi there,
Thank you for your feedback; we really appreciate it. We are always striving to improve our product, and your insights are truly valuable.
I will reach out to our engineering team regarding your query. Thanks again. FYI, we've raised a PR for the documentation update.
Thank you for your feedback; we really appreciate it. We are always striving to improve our product, and your insights are truly valuable.
I will reach out to our engineering team regarding your query. Thanks again. FYI, we've raised a PR for the documentation update.