Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bump keycloak to 4.1.0, use async keycloak methods #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fastapi_keycloak_middleware/keycloak_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ async def authenticate(self, conn: HTTPConnection) -> tuple[list[str], BaseUser
log.debug("Using introspection endpoint to validate token")
# Call introspect endpoint to check if token is valid
try:
token_info = self.keycloak_openid.introspect(token[1])
token_info = await self.keycloak_openid.a_introspect(token[1])
except keycloak.exceptions.KeycloakPostError as exc:
raise AuthKeycloakError from exc
else:
log.debug("Using keycloak public key to validate token")
# Decode Token locally using the public key
token_info = self.keycloak_openid.decode_token(
token_info = await self.keycloak_openid.a_decode_token(
token[1],
self.keycloak_configuration.validate_token,
**self.keycloak_configuration.validation_options,
Expand Down
28 changes: 20 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ packages = [{ include = "fastapi_keycloak_middleware" }]
[tool.poetry.dependencies]
python = "^3.10"
fastapi = ">=0.73.0"
python-keycloak = "^4.0.0"
python-keycloak = "^4.1.0"


[tool.poetry.group.dev.dependencies]
Expand Down