potiuk commented on code in PR #35085:
URL: https://github.com/apache/airflow/pull/35085#discussion_r1410905233


##########
airflow/auth/managers/fab/security_manager/override.py:
##########
@@ -1432,23 +1430,14 @@ def get_oauth_user_info(self, provider, resp):
                 "last_name": data.get("family_name", ""),
                 "email": data.get("email", ""),
             }
-        # for Azure AD Tenant. Azure OAuth response contains
-        # JWT token which has user info.
-        # JWT token needs to be base64 decoded.
-        # https://docs.microsoft.com/en-us/azure/active-directory/develop/
-        # active-directory-protocols-oauth-code
         if provider == "azure":
-            log.debug("Azure response received : %s", resp)
-            id_token = resp["id_token"]
-            log.debug(str(id_token))
-            me = self._azure_jwt_token_parse(id_token)
-            log.debug("Parse JWT token : %s", me)
+            me = self._decode_and_validate_azure_jwt(resp["id_token"])
+            log.debug("User info from Azure: %s", me)
+            # 
https://learn.microsoft.com/en-us/azure/active-directory/develop/id-token-claims-reference#payload-claims
             return {
-                "name": me.get("name", ""),
-                "email": me["upn"],
+                "email": me["email"],

Review Comment:
   Well. This has been straight copied from FAB 4.3.9  - unless I made a 
mistake of course. We don't even analyse that we are just making sure that we 
have the same code as the original FAB Securiy Manager Has.
   
   So if there is any problem with it - it should rather be raised to FAB not 
to us - our change is simply a `direct`  pass-through to FAB.
   
   However this is a very valid point - I see that last week FAB released 
version 4.3.10 which contains this one: 
https://github.com/dpgaspar/Flask-AppBuilder/pull/2163   which solves precisely 
the problem you mention.
   
   So ... time to upgrade to 4.3.10 it seems.



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