microsoftgraph / microsoftgraph/msgraph-beta-sdk-python

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

Open
#987 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:waiting-for-triage type:bug
Dominant language
Python
Stars
44
Forks
16
Avg merge
20h 39m
Merged PRs (30d)
3

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generated models/sign_in.py location linked in the issue, especially the authentication_protocol handling around line 295. Run the provided sign-in retrieval example and compare the SDK value with the Graph beta response; done means authentication_protocol contains the returned allowed value instead of an empty list.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.