[Bug] MSAL.PY's error has no indicator for `InteractionRequired`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- authentication, backend-api-design
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 971
- Fork
- 223
- Merge trung bình
- 13 giờ 48 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AzureAD/microsoft-authentication-library-for-python
-
needs attention untriaged
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
AzureAD/microsoft-authentication-library-for-python#973 · 1 bình luận ·
-
AzureSDK bug P1
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
http_client docstring does not say that timeout, verify and proxies only configure the default sessionCó thể đã có người làm @HardMax71 đã nhận 40 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 25/100
-
[Bug] The built-in retry never retries the token POST: HTTPAdapter(max_retries=1) keeps urllib3's default allowed_methodsCó thể đã có người làm @HardMax71 đã nhận 46 ngày trước. Đang mởbug untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
AzureAD/microsoft-authentication-library-for-python#957 · 3 bình luận ·
-
public-client untriaged
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của AzureAD/microsoft-authentication-library-for-python
Issue tương tự
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
selimfirat/pysad#379 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#32805 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix: [bug description] HTML CVE metric table shows only the last CVE for each productCó thể đã có người làm @Chris-wh233 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
ossf/cve-bin-tool#5976 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
gke-labs/kube-agents#3615 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
deferred
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày