Azure AD B2C审核日志-图形API-查询选项不起作用 [英] Azure AD B2C Audit Logs - Graph API - query options not working

查看:63
本文介绍了Azure AD B2C审核日志-图形API-查询选项不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我们的租户检索Azure AD用户登录审核日志.为此,我正在使用[Microsoft的图形API] [1]

I am trying to retrieve the Azure AD user sign-in audit logs for our tenant. For this, I am using [Microsoft’s graph APIs][1]

https://graph.microsoft.com/v1.0/auditLogs/signIns?$filter=createdDateTime ge 2019-10-08T09:00:00.0000000 and createdDateTime le 2019-10-08T09:12:00.0000000

在上述示例中, 我正在尝试根据查询选项$filter过滤日志,在这里我尝试根据createDateTime

In the above-given example, I am trying to filter the logs based on a query option, $filter where I am trying to retrieve the records based on createDateTime,

从日期2019-10-08T09:00:00.0000000到日期2019-10-08T09:12:00.0000000.

from Date 2019-10-08T09:00:00.0000000 and to date 2019-10-08T09:12:00.0000000.

每次我都从当前时间获取记录并返回历史记录.这意味着,无论我提供什么日期范围,它都会被忽略.

Every time I am getting the records from the current time and going back in history. This means, irrespective of any date range I provide, it gets ignored.

为此,当我应用任何OData时(

For that matter when I apply any OData (https://docs.microsoft.com/en-us/graph/query-parameters#odata-system-query-options) query options ($top, $orderby, etc), the API still returns with the latest audit logs and none of the query options seems to work.

这可能是由于权限或许可引起的吗?非常感谢您的帮助.

Could this be due to the permissions or the license? Any help is much appreciated.

使用给定的日期范围,我应该能够获取这些范围之间的审核日志.

With the given date ranges I should be able to get the audit logs between the ranges.

推荐答案

我终于找到了答案.我正在发送Url的查询选项部分的编码(HttpUtility.UrlEncode)版本,由于某些原因,Graph API不喜欢.

I finally found the answer. I was sending the encoded(HttpUtility.UrlEncode) version of the query options part of the Url, which Graph API doesn’t like for some reason.

这篇关于Azure AD B2C审核日志-图形API-查询选项不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆