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
passwordgrant 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_keycloak_auth_lib-0.1.4.tar.gz.
File metadata
- Download URL: fastapi_keycloak_auth_lib-0.1.4.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0f83d7e887040b12010abe1ee5a2cb078614d47dfac47cebabae99a75cf3378
|
|
| MD5 |
3125d21b38e80b1de475416298bba80f
|
|
| BLAKE2b-256 |
56c025481a6418d7b6b70bd596c66e3e6406093b101bc640277e529b00356327
|
File details
Details for the file fastapi_keycloak_auth_lib-0.1.4-py3-none-any.whl.
File metadata
- Download URL: fastapi_keycloak_auth_lib-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c37d58b93420f11f43432ff9809230608bce7d4418c484978f7fb09cc27c6365
|
|
| MD5 |
44782965b3abc7c62c1615fc32c5caf6
|
|
| BLAKE2b-256 |
d8d89ff099bb59a3c2aa79176347e50a36e5b662e0fef929af44c6230cda8532
|