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.4.0.tar.gz (225.4 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.4.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_zitadel_auth-0.4.0.tar.gz
  • Upload date:
  • Size: 225.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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.4.0.tar.gz
Algorithm Hash digest
SHA256 c9a7cda76edeea0f51ed11db49f0369b844613dc3b2de06958cbe168952414b3
MD5 6db3ec9b2567e9c45b511ad78e9d2261
BLAKE2b-256 dda7813a3887fb31587519424085ca6c7480759ec6275e2f32d525bc8abcc7c3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastapi_zitadel_auth-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a518e9b4b33d615268a9849653f6720dd67d778eccd5c6658aa4e7bb175ae69
MD5 a4cddc3fc9512c7966b76e3b4acad51b
BLAKE2b-256 c226ac8774f96fd11abcd4bffb25a4d73f98c8be714a7cb060b112045030df99

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