microsoftgraph / microsoftgraph/msgraph-beta-sdk-python

authentication_protocol property of sign-ins events is always an empty list

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

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

status:waiting-for-triage type:bug
Ngôn ngữ chính
Python
Star
44
Fork
16
Merge trung bình
20 giờ 39 phút
Pull request đã merge (30 ngày)
3

Mô tả

Describe the bug

When accessing a sign-in event, for example via audit_logs.sign_ins.get() the authentication_protocol property is always an empty list ([]).

If you look at the same sign-in event in Entra ID or Graph Explorer, the field authenticationProtocol is properly filled.

Expected behavior

The authentication_protocol property should contain one of the allowed values. See https://learn.microsoft.com/en-us/graph/api/resources/signin?view=graph-rest-beta#properties -> authenticationProtocol

How to reproduce

Run

import asyncio
from azure.identity.aio import ClientSecretCredential
from msgraph_beta import GraphServiceClient

credential = ClientSecretCredential(
    'tenant_id',
    'client_id',
    'client_secret'
)

scopes = ['https://graph.microsoft.com/.default']
graph_client = GraphServiceClient(credential, scopes=scopes)

async def get_signins()-> None:
    signins =await graph_client.audit_logs.sign_ins.get()
    for signin in signins.value:
        print(signin.authentication_protocol)


asyncio.run(get_signins())

and compare it to the authenticationProtocol field in the output of https://graph.microsoft.com/beta/auditLogs/signIns

SDK Version

1.51.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Configuration
  • OS: Ubuntu 22.04
  • architecture: x86_64
Other information

I suspect the usage of get_collection_of_enum_values() instead of get_enum_value() to be the reason for this:
https://github.com/microsoftgraph/msgraph-beta-sdk-python/blob/a606d0365c39a5c2e5f658841a1a7c58d270438b/msgraph_beta/generated/models/sign_in.py#L295

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Bắt đầu với vị trí generated models/sign_in.py được liên kết trong issue, đặc biệt là phần xử lý authentication_protocol quanh dòng 295. Chạy ví dụ truy xuất thông tin đăng nhập được cung cấp và so sánh giá trị SDK với phản hồi của Graph beta; được xem là hoàn thành khi authentication_protocol chứa giá trị được phép được trả về thay vì một danh sách rỗng.

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

Đánh giá

Công nghệ
python
Lĩnh vực
api
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
48/100

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.