Failed Azure Credential errors not displayed to user without Debug Logging

Đang mở
#680 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 4 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
azure, go
Lĩnh vực
authentication, cloud

Hướng nghiên cứu

Bắt đầu bằng cách lần theo quá trình MAPT lấy thông tin xác thực Azure và đường dẫn ghi log được sử dụng khi DefaultAzureCredential thất bại. Tái hiện lỗi do thông tin xác thực hết hạn với tính năng ghi log gỡ lỗi bị tắt; hoàn tất khi các lỗi xác thực liên quan, không nhạy cảm được hiển thị trên đầu ra chuẩn hoặc đầu ra lỗi mà không bật tính năng ghi log gỡ lỗi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

MAPT currently fails to display critical Azure authentication errors to the user unless debug logging is explicitly enabled.

The output shows a generic success-like message (DEBU context initialized for mapt...) followed by a silent failure of DefaultAzureCredential due to an expired client secret (AADSTS7000222: The provided client secret keys for app '***' are expired.).

Impact: Users cannot diagnose the root cause of an apparent application failure without manually enabling verbose logging, leading to poor user experience and increased troubleshooting time.

Required Fix: MAPT should be updated to surface relevant, non-sensitive errors from the underlying Azure (like expired credentials or authorization failures) to the standard output or error stream, regardless of the debug log setting.

Example Log (Requires Debug Mode)
The following log snippet shows the critical error, which was only visible after enabling debug mode:

DEBU context initialized for mapt298473c3 DefaultAzureCredential: failed to acquire a token. Attempted credentials: ClientSecretCredential authentication failed. POST https://login.microsoftonline.com/***/oauth2/v2.0/token -------------------------------------------------------------------------------- RESPONSE 401: 401 Unauthorized -------------------------------------------------------------------------------- { "error": "invalid_client", "error_description": "AADSTS7000222: The provided client secret keys for app '***' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 20d540d3-389e-4e97-aa72-42c53ac10700 Correlation ID: c704f263-d933-4b48-b46c-04a036f9d060 Timestamp: 2025-12-04 08:33:07Z", "error_codes": [ 7000222 ], "timestamp": "2025-12-04 08:33:07Z", "trace_id": "20d540d3-389e-4e97-aa72-42c53ac10700", "correlation_id": "c704f263-d933-4b48-b46c-04a036f9d060", "error_uri": "https://login.microsoftonline.com/error?code=7000222" } -------------------------------------------------------------------------------- To troubleshoot, visit https://aka.ms/azsdk/go/identity/troubleshoot#client-secret

Ngôn ngữ chính
Go
Star
25
Fork
41
Merge trung bình
5 ngày 3 giờ
Pull request đã merge (30 ngày)
16

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của redhat-developer/mapt

Tất cả issue của redhat-developer/mapt

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.