[Bug] MSAL.PY's error has no indicator for `InteractionRequired`
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
Start by reading the MSAL Python error handling and token acquisition paths referenced by the issue, along with the linked Azure CLI handling and interactive sample. Identify how errors expose interaction requirements with and without WAM. Done means MSAL provides a clear indicator clients can use without parsing error_description.
由索引模型根據 Issue 內容生成。
描述
Describe the bug
Azure CLI relies on AADSTS50076 to detect MFA error (https://github.com/Azure/azure-cli/pull/12516):
if 'AADSTS50076' in msg:
# The tenant requires MFA and can't be accessed with home tenant's refresh token
mfa_tenants.append(t)
and let the user know interaction is required:
# Show warning for MFA tenants
if mfa_tenants:
logger.warning("The following tenants require Multi-Factor Authentication (MFA). "
"Use 'az login --tenant TENANT_ID' to explicitly login to a tenant.")
for t in mfa_tenants:
logger.warning("%s", t.tenant_id_name)
Today I was told by MSAL team that clients shouldn't parse error_description. However, MSAL.PY has no clear indicator that interaction is required, with or without WAM:
With WAM:
{
"error": "broker_error",
"error_description": "SubError: basic_action V2Error: invalid_grant AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access 'xxx'. Trace ID: xxx Correlation ID: xxx Timestamp: 2024-05-15 01:13:49Z. Status: Response_Status.Status_InteractionRequired, Error code: 3399614476, Tag: 557973645",
"msal_telemetry": "..."
}
Without WAM:
{
"error": "invalid_grant",
"error_description": "AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access 'xxx'. Trace ID: xxx Correlation ID: xxx Timestamp: 2024-05-15 01:16:43Z",
"error_codes": [
50076
],
"timestamp": "2024-05-15 01:16:43Z",
"trace_id": "xxx",
"correlation_id": "xxx",
"error_uri": "https://login.microsoftonline.com/error?code=50076",
"suberror": "basic_action",
"classification": "basic_action"
}
This makes Azure CLI have no way of knowing whether the error can be recovered by performing interactive authentication.
The MSAL example unconditionally launches acquire_token_interactive if acquire_token_silent fails to get an access token:
To Reproduce
az login with an account that requires MFA for non-home tenants.
Expected behavior
MSAL.PY's error should have an indicator for InteractionRequired.
What you see instead
MSAL.PY's error has no indicator for InteractionRequired.
The MSAL Python version you are using
1.28.0
Additional context
Add any other context about the problem here.
- 主要語言
- Python
- 星號
- 971
- 分支
- 223
- 平均合併
- 13 小時 48 分鐘
- 30 天內合併 PR
- 2
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
AzureAD/microsoft-authentication-library-for-python 的其他 Issue
-
needs attention untriaged
難度 4/5 3-5 天 新手友好度 48/100
AzureAD/microsoft-authentication-library-for-python#973 · 1 則留言 ·
-
AzureSDK bug P1
難度 4/5 3-5 天 新手友好度 48/100
-
http_client docstring does not say that timeout, verify and proxies only configure the default session可能已有人在做 @HardMax71 於 40 天前認領。 未關閉
難度 1/5 1 小時以內 新手友好度 25/100
-
[Bug] The built-in retry never retries the token POST: HTTPAdapter(max_retries=1) keeps urllib3's default allowed_methods可能已有人在做 @HardMax71 於 46 天前認領。 未關閉bug untriaged
難度 2/5 1-3 小時 新手友好度 35/100
AzureAD/microsoft-authentication-library-for-python#957 · 3 則留言 ·
-
public-client untriaged
難度 5/5 一週以上 新手友好度 25/100
查看 AzureAD/microsoft-authentication-library-for-python 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
anchore/grype-db#1149 · 1 則留言 ·
維護者通常 1 天內回覆
-
[Bug]: `hermes plugins update` clones an entire monorepo twice - `subdir` is resolved but dropped at both catalog-update call sites可能已有人在做 @HootRock 今天認領。 未關閉comp/cli P2 type/perf
難度 2/5 1-3 小時 新手友好度 72/100
NousResearch/hermes-agent#142417 · 2 則留言 ·
維護者通常 1 天內回覆
-
SMC SPEC
難度 2/5 1-3 小時 新手友好度 70/100
tenstorrent/tt-oca-harness#3287 ·
維護者通常 1 天內回覆
-
bug enhancement python
難度 2/5 1-3 小時 新手友好度 85/100
DewaldOosthuizen/tech-cheat-sheets-and-notes#392 ·
維護者通常 1 天內回覆
-
security
難度 2/5 1-3 小時 新手友好度 72/100
fabriziosalmi/wildbox#801 ·
維護者通常 1 天內回覆