microsoftgraph / microsoftgraph/msgraph-beta-sdk-python
authentication_protocol property of sign-ins events is always an empty list
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 44
- 派生
- 16
- 平均合并
- 20 小时 39 分钟
- 30 天内合并 PR
- 3
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 issue 中链接的 generated models/sign_in.py 位置开始,重点检查第 295 行附近对 authentication_protocol 的处理。运行提供的登录信息获取示例,并将 SDK 值与 Graph beta 响应进行比较;当 authentication_protocol 包含返回的允许值而不是空列表时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- api
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 48/100