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.0rc1.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.0rc1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_zitadel_auth-0.4.0rc1.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.0rc1.tar.gz
Algorithm Hash digest
SHA256 b68928226aa8ab621674a2befe198e3f811a7aa7cecbc0867db1d9c70e8926f6
MD5 b200db03848239cd12cb85505a6e8bde
BLAKE2b-256 3a99c9f96a019416baff07342f719d86054992bc5bbf2a5c3656b21ee45464b8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastapi_zitadel_auth-0.4.0rc1-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.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a5667156e2bb8482dedf3ca94874899f299b15c075cfdebc728cfa5bb2f3c8a
MD5 0a298bf83273f86f1e94a33f95fd45b8
BLAKE2b-256 d3421f1da445915d77d528c0a24a414e6f975b4a15829d0c2173d4fb5ed696ea

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