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

问题描述

我正在尝试检索Azure AD B2C用户登录审核日志,但是它低于错误

  var signIns =等待_graphClient.AuditLogs.SignIns.要求().GetAsync(); 

失败:Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware [1]执行请求时发生未处理的异常.状态码:禁止Microsoft.Graph.ServiceException:代码:Authentication_RequestFromNonPremiumTenantOrB2CTenant消息:租户不是B2C或租户都没有高级许可证


内部错误:附加数据:日期:2020-10-05T10:12:34要求编号:1740dcc7-3ffd-4d81-a721-a18e3fee0e1a客户端请求ID:1740dcc7-3ffd-4d81-a721-a18e3fee0e1aClientRequestId:1740dcc7-3ffd-4d81-a721-a18e3fee0e1a

在Microsoft.Graph.HttpProvider.SendAsync中的

(HttpRequestMessage请求,HttpCompletionOptioncompleteOption,CancellationToken cancelledToken)在Microsoft.Graph.BaseRequest.SendRequestAsync(Object serializableObject,CancellationToken cancelToken,HttpCompletionOptioncompleteOption)在Microsoft.Graph.BaseRequest.SendAsync [T](对象serializableObject,CancellationToken cancelToken,HttpCompletionOption完成选项)在Microsoft.Graph.AuditLogRootSignInsCollectionRequest.GetAsync(CancellationToken cancelleToken)上.

预先感谢

解决方案

要访问登录报告,需要Azure Active Directory Premium 1(P1)许可证.

I am trying to retrieve the Azure AD B2C users sign-in audit logs, but its throw below error

    var signIns = await _graphClient.AuditLogs.SignIns
        .Request()
        .GetAsync();

fail:Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1] An unhandled exception has occurred while executing the request.Status Code: ForbiddenMicrosoft.Graph.ServiceException: Code: Authentication_RequestFromNonPremiumTenantOrB2CTenantMessage: Neither tenant is B2C or tenant doesn't have premium license


Inner error:AdditionalData:date: 2020-10-05T10:12:34request-id: 1740dcc7-3ffd-4d81-a721-a18e3fee0e1aclient-request-id: 1740dcc7-3ffd-4d81-a721-a18e3fee0e1aClientRequestId: 1740dcc7-3ffd-4d81-a721-a18e3fee0e1a

at Microsoft.Graph.HttpProvider.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)at Microsoft.Graph.BaseRequest.SendRequestAsync(Object serializableObject, CancellationToken cancellationToken, HttpCompletionOption completionOption)at Microsoft.Graph.BaseRequest.SendAsync[T](Object serializableObject, CancellationToken cancellationToken, HttpCompletionOption completionOption)at Microsoft.Graph.AuditLogRootSignInsCollectionRequest.GetAsync(CancellationToken cancellationToken).

Thanks in advance

解决方案

This is accessing sign-in reports requires an Azure Active Directory premium 1 (P1) license.

Check it in Azure Portal Licenses.

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

08-21 03:13