-
code = context.acquire_user_code(auth_resource or resource, _CLIENT_ID)
logger.warning(code['message'])
token_entry = context.acquire_token_with_device_code(resource, code, _CLIENT_ID) Azure CLI
In the second step, the date sent to https://login.microsoftonline.com/common/oauth2/token is confirmed to be
But the returned token entry has
This results in Azure CLI command failure:
This breaks conditional access MFA scenario. According to https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-device-code#authenticating-the-user, it looks like |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The underlying Device Code Flow specs never defines a MSAL Python avoids this mistake by not accepting a Thanks for reporting this. The workaround in ADAL Python is "do not use the |
Beta Was this translation helpful? Give feedback.
-
Thanks you so much @rayluo. I am only opening this issue for others who bump into it. |
Beta Was this translation helpful? Give feedback.
The underlying Device Code Flow specs never defines a
scope
(orresource
, for that matter) in the second leg. The ADAL Python's API surface happened to contain aresource
parameter for the second step. That was a design mistake.MSAL Python avoids this mistake by not accepting a
scope
parameter in the second step at all.Thanks for reporting this. The workaround in ADAL Python is "do not use the
resource
parameter in the second step". And the better solution is to "migrate to MSAL Python", which Azure CLI will do soon. I'll still have to mark this as WontFix here.