Skip to main content

Zitadel authentication for FastAPI

Project description

FastAPI Zitadel Auth

Simplify OAuth2 authentication and authorization in FastAPI apps using Zitadel.

Test status Code coverage Package version PyPI downloads Python versions mypy

Documentation: https://cleanenergyexchange.github.io/fastapi-zitadel-auth

Source Code: https://github.com/cleanenergyexchange/fastapi-zitadel-auth


Features

  • Authorization Code flow with PKCE
  • JWT validation using JWKS
  • Role-based access control using Zitadel roles
  • Service user authentication (JWT Profile)
  • Swagger UI integration
  • Type-safe token validation
  • Extensible claims and user models
  • Async loading of OpenID configuration

Note: This library implements JWT, locally validated using JWKS, as it prioritizes performance, see Zitadel docs on Opaque tokens vs JWT. If you need to validate opaque tokens using Introspection, please open an issue – PRs are welcome!

License

This project is licensed under the terms of the MIT license.

Acknowledgements

This package was heavily inspired by intility/fastapi-azure-auth. Give them a star ⭐️!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_zitadel_auth-0.5.0.tar.gz (225.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_zitadel_auth-0.5.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_zitadel_auth-0.5.0.tar.gz.

File metadata

  • Download URL: fastapi_zitadel_auth-0.5.0.tar.gz
  • Upload date:
  • Size: 225.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fastapi_zitadel_auth-0.5.0.tar.gz
Algorithm Hash digest
SHA256 18d9fbd19de06ae487d947003b78a2d4c45b02784176a366dbe9904c9e3e2a2e
MD5 c152483221b1273f329f8959f04c9279
BLAKE2b-256 5dd3a9620604d0281846eb7b3b588f842d0831c6aeff0017e8600bc631bf3b03

See more details on using hashes here.

File details

Details for the file fastapi_zitadel_auth-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: fastapi_zitadel_auth-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fastapi_zitadel_auth-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da6facda785d2f018e3f024c36db7b52f9d27c92accb3c51b668600b3107ba39
MD5 e6bd18606c7b7fc137f3e9d3d5af3057
BLAKE2b-256 403334c22e791de448e0076e66faec30d70559a7648ec6cc139cb1f0a69f7816

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page