potiuk commented on code in PR #35085:
URL: https://github.com/apache/airflow/pull/35085#discussion_r1411379983
##########
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:
Merged in https://github.com/apache/airflow/pull/35991 -> will be released
in 2.8.0
--
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]