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.12.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.12-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for fastapi_keycloak_auth_lib-0.1.12.tar.gz
Algorithm Hash digest
SHA256 453dd5f012972ca742789810d9482b4271f50fea56fa2b3e4365587bf6cb237f
MD5 4300976edfe69b7e0637461c5b2d2deb
BLAKE2b-256 363485ddfc5ceeb8e247b2b9fa5c1b259e204faad1962d4d9cfc48123977c644

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_keycloak_auth_lib-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 96da80b93b7de1d31d94bf6794822f67b681c2a21b5953b0fddab1d4ea5eaf68
MD5 3141c1308fc887941153a650219eac05
BLAKE2b-256 5544393f01509324060bfa3e4e10d7256820ce32398ce841959a7dd0c872f9a7

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