microsoftgraph / microsoftgraph/msgraph-beta-sdk-python

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

Abierto
#987 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

status:waiting-for-triage type:bug
Lenguaje dominante
Python
Estrellas
44
Forks
16
Merge medio
20 h 39 min
PR fusionados (30 d)
3

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con la ubicación de generated models/sign_in.py enlazada en el issue, especialmente con el manejo de authentication_protocol alrededor de la línea 295. Ejecuta el ejemplo proporcionado para recuperar el inicio de sesión y compara el valor del SDK con la respuesta de Graph beta; se considera terminado cuando authentication_protocol contiene el valor permitido devuelto en lugar de una lista vacía.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
api
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.