Comments (3)
The relevant patch to fix the issue:
From 62ab0b96af3f150797c454527ed661e4bfa92c1e Mon Sep 17 00:00:00 2001
From: Moritz Ulmer <[email protected]>
Date: Tue, 14 Feb 2023 09:37:40 +0000
Subject: [PATCH] 507-fix-fetching-user-details-after-timeout
Why:
- Allow Keycloak admin queries to be made after initial deployment
This change addresses the need by:
- Refreshing tokens by default for all HTTP method calls in KC-admin
Closes #507
---
src/django_keycloak/config.py | 4 ++++
src/django_keycloak/connector.py | 1 +
2 files changed, 5 insertions(+)
diff --git a/src/django_keycloak/config.py b/src/django_keycloak/config.py
index b4a08f25..b3806bad 100644
--- a/src/django_keycloak/config.py
+++ b/src/django_keycloak/config.py
@@ -39,6 +39,10 @@ class Settings:
USER_INFO_IN_TOKEN: Optional[bool] = True
# Flag to show the traceback of debug logs
TRACE_DEBUG_LOGS: Optional[bool] = False
+ # For the KeycloakAdmin, which HTTP methods to refresh the token for
+ AUTO_REFRESH_TOKEN: Optional[List[str]] = field(
+ default_factory=lambda: ["get", "put", "post", "delete"]
+ )
# The token prefix
TOKEN_PREFIX: Optional[str] = "Bearer"
# Derived setting of the SERVER/INTERNAL_URL and BASE_PATH
diff --git a/src/django_keycloak/connector.py b/src/django_keycloak/connector.py
index d83e4173..26d00fac 100644
--- a/src/django_keycloak/connector.py
+++ b/src/django_keycloak/connector.py
@@ -76,4 +76,5 @@ lazy_keycloak_admin = LazyKeycloakAdmin(
client_id=settings.CLIENT_ID,
realm_name=settings.REALM,
client_secret_key=settings.CLIENT_SECRET_KEY,
+ auto_refresh_token=settings.AUTO_REFRESH_TOKEN,
)
--
from django-keycloak-auth.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.
from django-keycloak-auth.
This issue was closed because it has been stalled for 7 days with no activity.
from django-keycloak-auth.
Related Issues (20)
- Add caching to JWT decoding
- Fix library dependencies
- Make middleware async capable
- Is this installable with pip? HOT 5
- How does logging work? HOT 4
- Databse migration error: ValueError: Related model 'django_keycloak.keycloakuserautoid' cannot be resolved HOT 3
- Could we make URLs more configurable? HOT 4
- How to restric admin login to specific users? HOT 4
- Django application with Integration tests HOT 3
- Improve Readme HOT 1
- IntegrityError: null value in column "email" violates not-null constraint HOT 5
- IntegrityError null value in column "first_name" of relation "users_keycloakprofile" violates not null constraint HOT 4
- Set up CI test coverage report HOT 2
- Enable dependabot HOT 4
- Fix package publishing HOT 2
- [docs] how to register new user from Django to keyCloak and sign-in - JWT HOT 3
- [bug] user with no email in keycloak are failing to login in Django HOT 3
- Add stale bot to handle inactive issues and PRs HOT 1
- Write in the documentation about configuring keycloak HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-keycloak-auth.