FastAPI Keycloak Extended
Project description
FastAPI Keycloak Integration
Welcome to fastapi-keycloak
. This projects goal is to ease the integration of Keycloak (OpenID Connect) with Python, especially FastAPI. FastAPI is not necessary but is
encouraged due to specific features. Currently, this package supports only the password
and the authorization_code
. However, the get_current_user()
method accepts any JWT
that was signed using Keycloak´s private key.
Docs
Refer to https://fastapi-keycloak.code-specialist.com/.
Adding some features:
- KeycloakToken with more datas (refresh token, expires_in, etc.)
- KeycloakRefreshToken represents the response after refresh token
- KeycloakGroup with field
attributes
- Function to retrieve groups by attribute
- Update call api GET (for users and groups) with param briefRepresentation as false. This allows to get the full representation of the object.
- Update create_user and create_group
- Function to refresh token
- Override user_login to take an account more details
- Update OIDCUser to add field from attributes
This exposes all fastapi_keycloak features under fastapi_keycloak_extended.
Keycloak version
Module tested with version of keycloak:
- 16.0 (server uri must end with /auth )
- 22.0
Build and publish
Refer to https://packaging.python.org/en/latest/tutorials/packaging-projects/
Step:
- python -m build
- python -m twine upload --repository pypi dist/*
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
Built Distribution
File details
Details for the file fastapi_keycloak_extended-1.0.10.1.tar.gz
.
File metadata
- Download URL: fastapi_keycloak_extended-1.0.10.1.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b47ff24c2c911522381f82c61bf53b3eaa33d33b1282550d1541933a5509c355 |
|
MD5 | f84c28a558fdd49818f0c061fd64a61d |
|
BLAKE2b-256 | 4716a078f84a70ad6c3c9437ea4401e820ea0a1e2ad24675a5aabd72270dbfa9 |
File details
Details for the file fastapi_keycloak_extended-1.0.10.1-py3-none-any.whl
.
File metadata
- Download URL: fastapi_keycloak_extended-1.0.10.1-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe0b448829b33629806dff40f3b0187a2bab110271d08530ce2643fb566d2743 |
|
MD5 | 93e774130f6b841c6cbdac487aae25aa |
|
BLAKE2b-256 | ebedf0a7dc778f233243b34f981adb4c7d88b663e2703af330413d0633938e59 |