Azure AD B2C Audit Logs - Graph API

我的梦境 提交于 2021-01-28 05:03:07

问题


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: Forbidden Microsoft.Graph.ServiceException: Code: Authentication_RequestFromNonPremiumTenantOrB2CTenant Message: Neither tenant is B2C or tenant doesn't have premium license


Inner error: AdditionalData: date: 2020-10-05T10:12:34 request-id: 1740dcc7-3ffd-4d81-a721-a18e3fee0e1a client-request-id: 1740dcc7-3ffd-4d81-a721-a18e3fee0e1a ClientRequestId: 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


回答1:


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

Check it in Azure Portal Licenses.



来源:https://stackoverflow.com/questions/64207326/azure-ad-b2c-audit-logs-graph-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!