簡體   English   中英

在 Microsoft graph API 1.0 中始終將 passwordPolicies 設為 null

[英]Getting passwordPolicies as null always in Microsoft graph API 1.0

我正在使用 Microsoft Graph API 1.0 版

我需要為使用圖形 API 的用戶獲取在 Azure Active Directory 中配置的密碼到期時間。

我使用了https://developer.microsoft.com/en-us/graph/graph-explorer

在 admin.microsoft.com 中,配置的值是密碼到期 14 天。 但是,Graph API 返回空值。 但是如果我們將密碼配置為永不過期,Graph API 將返回為DisablePasswordExpiration

我在 Graph Explorer 中請求的 API 是

GET https://graph.microsoft.com/v1.0/me?$select=passwordPolicies

無法從 Graph API 獲取密碼有效期。

您可以讀取的是用戶上次更改密碼或創建密碼的時間。

您需要調用beta API。

GET https://graph.microsoft.com/beta/me?$select=lastPasswordChangeDateTime

回復

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#users(lastPasswordChangeDateTime)/$entity",
    "lastPasswordChangeDateTime": "2022-05-10T10:31:55Z"
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM