如何通过postman从Azure AD获取lastSignInDateTime

问题描述 投票:0回答:1

我需要通过邮递员从Azure AD获取lastSignInDateTime。 我可以知道如何获取用户的详细信息

我尝试使用以下网址,但它对我不起作用。 “https://graph.microsoft.com/v1.0/users?$select=id,signInActivity”。

实际上我需要从 azure ad 获取此详细信息到 saviynt。 你可以在下面看到我使用的 json。

{
    "globalSettings": {
        "dateFormat": "yyyy-MM-dd'T'HH:mm:ss"
    },
    "accountParams": {
        "connection": "userAuth",
        "processingType": "SequentialAndIterative",
        "call": {
            "call1": {
                "callOrder": 0,
                "stageNumber": 0,
                "http": {
                    "url": "https://graph.microsoft.com/v1.0/users?$select=id,signInActivity",
                    "httpHeaders": {
                        "Authorization": "${access_token}",
                        "Accept": "application/json"
                    },
                    "httpContentType": "application/json",
                    "httpMethod": "GET"
                },
                "listField": "value",
                "keyField": "accountID",
                "colsToPropsMap": {
                    "accountID": "id~#~char",
                    "customproperty60": "signInActivity.lastSignInDateTime~#~char",
                    "lastlogondate": "signInActivity.lastSignInDateTime~#~date"
                }
            }
        }
    },
    "entitlementParams": {},
    "acctEntParams": {}
}
rest azure-active-directory microsoft-graph-api postman
1个回答
0
投票

我同意 @user2250152,要获取用户的

signInActivity
,Microsoft Entra ID 应用程序必须具有
AuditLog.Read.All
API 权限:

授予 API 权限,如下所示:

enter image description here

通过 Postman 使用以下参数

生成访问令牌

https://login.microsoftonline.com/TenantID/oauth2/v2.0/token

client_id:ClientID
client_secret:ClientSecret
scope:https://graph.microsoft.com/.default
grant_type:client_credentials

enter image description here

通过使用上述访问令牌,我能够成功获取用户的

signInActivity

GET https://graph.microsoft.com/v1.0/users?$select=id,signInActivity

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.