The Civic Auth SDK also works with any Python backend.
pip install civic-auth
pip install "civic-auth[fastapi]"
from fastapi import Depends from civic_auth.integrations.fastapi import create_auth_dependencies, create_auth_router civic_auth_dep, get_current_user, require_auth = create_auth_dependencies(config) @app.get("/admin/hello", dependencies=[Depends(require_auth)]) async def hello(user = Depends(get_current_user)): return f"hello {user.name}!"
Was this page helpful?