vincbeck commented on code in PR #59382:
URL: https://github.com/apache/airflow/pull/59382#discussion_r2620081632


##########
providers/keycloak/src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py:
##########
@@ -149,22 +149,29 @@ def get_url_logout(self) -> str | None:
 
     def refresh_user(self, *, user: KeycloakAuthManagerUser) -> 
KeycloakAuthManagerUser | None:
         if self._token_expired(user.access_token):
-            try:
-                log.debug("Refreshing the token")
-                client = self.get_keycloak_client()
-                tokens = client.refresh_token(user.refresh_token)
+            tokens = self.refresh_token(user=user)
+
+            if tokens:
                 user.refresh_token = tokens["refresh_token"]
                 user.access_token = tokens["access_token"]
                 return user
-            except KeycloakPostError as exc:
-                log.warning(
-                    "KeycloakPostError encountered during token refresh. "
-                    "Suppressing the exception and returning None.",
-                    exc_info=exc,
-                )
 
         return None
 
+    def refresh_token(self, *, user: KeycloakAuthManagerUser) -> dict:

Review Comment:
   You'll need to make some modifications, I only suggested the signature 
change but of course you need to change the different calls



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to