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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for fastapi_keycloak_auth_lib-0.1.8.tar.gz
Algorithm Hash digest
SHA256 a95320cac4545e6ff5ab5cc3ca0b89dfc55ccc2175fca723c056214cbbe947fe
MD5 0d3938b0454f4c85a50b288a8da3c825
BLAKE2b-256 2ee265d09e8413cac2fa6312cdeb1cfd18ada96f61fc023a1822a4c924a34174

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_keycloak_auth_lib-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1d6a91add4a562c3ecd832e9cf6ecb9124649f54da83dd008a023a417bc8143f
MD5 b53ee5490cda838faa850585b49573cd
BLAKE2b-256 41f0430e95c83d23b25db3c604935f0965ea819d72d5d1c9e8980f161b312f66

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