microsoftgraph / microsoftgraph/msgraph-beta-sdk-python

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

Ouverte
#987 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

status:waiting-for-triage type:bug
Langage dominant
Python
Étoiles
44
Forks
16
Merge moyen
20 h 39 min
PR mergées (30 j)
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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par l’emplacement de generated models/sign_in.py indiqué dans l’issue, en particulier par la gestion de authentication_protocol autour de la ligne 295. Exécutez l’exemple fourni de récupération de la connexion et comparez la valeur du SDK avec la réponse de Graph beta ; c’est terminé lorsque authentication_protocol contient la valeur autorisée renvoyée au lieu d’une liste vide.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
api
Type d'issue
Bug
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.