Skip to main content

FastAPI integration with Keycloak for authentication and role-based access control

Project description

fastapi-keycloak-auth

fastapi-keycloak-auth is a Python package that provides an easy integration of Keycloak authentication and role-based authorization into FastAPI applications. The package supports JWT token validation, role checks, and automatic token retrieval, making it simple to implement secure API access.

Features:

  • Keycloak Integration: Authenticate and retrieve JWT tokens from Keycloak using the password grant type.
  • Token Verification: Easily verify the JWT token with Keycloak's public key.
  • Role-based Access Control: Enforce role-based access with custom decorators.
  • Flexible Configuration: Easily configure Keycloak settings (URL, realm, client ID, username, and password) via environment variables or direct updates.

Installation:

You can install the package via pip:

pip install fastapi-keycloak-auth

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_keycloak_auth_lib-0.1.9.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

fastapi_keycloak_auth_lib-0.1.9-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_keycloak_auth_lib-0.1.9.tar.gz.

File metadata

File hashes

Hashes for fastapi_keycloak_auth_lib-0.1.9.tar.gz
Algorithm Hash digest
SHA256 bae82d4a4ce8a014237d2fc57d6be6572438a504851e8d1ec832880f90d9a23f
MD5 86ac750bccb18730f0bc63b56b09eb91
BLAKE2b-256 974be950b2749769ca6ebbe03ddd06a28e02c53de0a48d0089b65bda7f4d0aed

See more details on using hashes here.

File details

Details for the file fastapi_keycloak_auth_lib-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_keycloak_auth_lib-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 01f1a31a1c045b56ca3d4df9415c70831177de81b4506e5d6a25ea32d96b38fb
MD5 8712765beaa55a28917e9abfa94de8ea
BLAKE2b-256 bffbe5b4c1cbb519a31875b65be1c37b4b1269eb23e281c7cd89bbd750e2feed

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