简体   繁体   中英

Azure AD B2C Audit Logs - Graph API

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

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

Check it in Azure Portal Licenses .

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM