SameerMesiah97 commented on code in PR #61305:
URL: https://github.com/apache/airflow/pull/61305#discussion_r2751927745


##########
providers/keycloak/src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py:
##########
@@ -412,7 +412,10 @@ def _is_batch_authorized(
 
     @staticmethod
     def _get_token_url(server_url, realm):
-        return f"{server_url}/realms/{realm}/protocol/openid-connect/token"
+        # Normalize server_url by removing trailing slashes to prevent 
double-slash URLs
+        # when constructing paths. This is required for Keycloak 26.4+ which 
strictly
+        # rejects non-normalized paths with HTTP 400.
+        return 
f"{server_url.rstrip('/')}/realms/{realm}/protocol/openid-connect/token"

Review Comment:
   This comment seems too verbose . It can be  easily inferred from the code 
that trailing forward  slashes are being removed. I would shorten it to this:
   
   `# Normalize server_url to avoid double slashes (required for Keycloak 26.4+ 
strict path validation).`



-- 
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