获取 accessPackageAssignmentPolicy

命名空间:microsoft.graph

重要

Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。

在 Microsoft Entra 权利管理中,检索 accessPackageAssignmentPolicy 对象的属性和关系。

此 API 可用于以下国家级云部署。

全局服务 美国政府 L4 美国政府 L5 (DOD) 由世纪互联运营的中国
✅ ✅ ✅ ✅

权限

为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。

权限类型 最低特权权限 更高特权权限
委派(工作或学校帐户) EntitlementManagement.Read.All EntitlementManagement.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。 不支持。
应用程序 EntitlementManagement.Read.All EntitlementManagement.ReadWrite.All

提示

对于使用工作或学校帐户的委派访问权限,必须通过以下选项之一为登录用户分配具有受支持角色权限的管理员角色:

  • 权利管理系统中的角色,其中最小特权角色为:
    • 目录读取者。 这是特权最低的选项
    • 目录创建者
    • 访问包管理器
  • 此操作支持的更多特权 Microsoft Entra 角色:
    • 安全信息读取者
    • 全局读取者
    • 合规性管理员
    • 安全管理员
    • Identity Governance Administrator

在仅限应用的情况下,可为调用应用分配上述支持的角色之一,而不是 EntitlementManagement.Read.All 应用程序权限。 目录读取者角色的特权低于EntitlementManagement.Read.All应用程序权限。

有关详细信息,请参阅 权利管理中的委派和角色以及如何 将 访问治理委托给权利管理中的访问包管理员。

HTTP 请求

GET /identityGovernance/entitlementManagement/accessPackageAssignmentPolicies/{id}

可选的查询参数

此方法支持 $select OData 查询参数,以帮助自定义响应。 若要了解一般信息,请参阅 OData 查询参数。

请求标头

名称 说明
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权。

请求正文

请勿提供此方法的请求正文。

响应

如果成功,此方法将在响应正文中返回 200 OK 响应代码和请求的 accessPackageAssignmentPolicy 对象。

示例

示例 1:检索策略

请求

以下示例显示了一个请求。

GET https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/accessPackageAssignmentPolicies/b2eba9a1-b357-42ee-83a8-336522ed6cbf

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 200 OK
Content-type: application/json

{
  "id": "b2eba9a1-b357-42ee-83a8-336522ed6cbf",
  "accessPackageId": "1b153a13-76da-4d07-9afa-c6c2b1f2e824",
  "displayName": "All Users",
  "description": "All users in the directory can request access.",
  "canExtend": false,
  "durationInDays": 365,
  "accessReviewSettings": null
}

示例 2:检索策略的自定义扩展处理程序

请求

下面的示例显示了一个请求,用于检索为策略及其关联的自定义工作流扩展定义的自定义扩展处理程序的集合。

GET https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/accessPackageAssignmentPolicies/4540a08f-8ab5-43f6-a923-015275799197?$expand=customExtensionHandlers($expand=customExtension)

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 200 OK
Content-type: application/json

{
    "id": "4540a08f-8ab5-43f6-a923-015275799197",
    "displayName": "policy with custom access package workflow extension",
    "description": "Run specified custom access package workflow extension at different stages.",
    "canExtend": true,
    "durationInDays": 0,
    "expirationDateTime": null,
    "accessPackageId": "ba5807c7-2aa9-4c8a-907e-4a17ee587500",
    "accessReviewSettings": null,
    "requestorSettings": {
        "scopeType": "AllExistingDirectorySubjects",
        "acceptRequests": true,
        "allowedRequestors": []
    },
    "requestApprovalSettings": {
        "isApprovalRequired": false,
        "isApprovalRequiredForExtension": false,
        "isRequestorJustificationRequired": false,
        "approvalMode": "NoApproval",
        "approvalStages": []
    },
    "customExtensionHandlers": [
        {
            "id": "5a38d27a-b702-48d9-ac72-dcf158ba1b0d",
            "stage": "assignmentRequestCreated",
            "customExtension": {
                "id": "219f57b6-7983-45a1-be01-2c228b7a43f8",
                "displayName": "test_action_1",
                "description": "Test logic app",
                "createdDateTime": "2022-01-11T05:19:16.97Z",
                "lastModifiedDateTime": "2022-01-11T05:19:16.97Z",
                "endpointConfiguration": {
                    "@odata.type": "#microsoft.graph.logicAppTriggerEndpointConfiguration",
                    "subscriptionId": "38ab2ccc-3747-4567-b36b-9478f5602f0d",
                    "resourceGroupName": "resourcegroup",
                    "logicAppWorkflowName": "customextension_test"
                },
                "authenticationConfiguration": {
                    "@odata.type": "#microsoft.graph.azureAdTokenAuthentication",
                    "resourceId": "f604bd15-f785-4309-ad7c-6fad18ddb6cb"
                }
            }
        }
    ]
}

示例 3:检索策略的自定义扩展阶段设置

请求

以下示例显示了一个请求,以检索为策略及其关联的访问包自定义工作流扩展定义的自定义扩展阶段设置的集合。

GET https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/accessPackageAssignmentPolicies/4540a08f-8ab5-43f6-a923-015275799197?$expand=customExtensionStageSettings($expand=customExtension)

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 200 OK
Content-type: application/json

{
    "id": "4540a08f-8ab5-43f6-a923-015275799197",
    "displayName": "policy with custom access package workflow extension",
    "description": "Run specified custom access package workflow extension at different stages.",
    "canExtend": true,
    "durationInDays": 0,
    "expirationDateTime": null,
    "accessPackageId": "ba5807c7-2aa9-4c8a-907e-4a17ee587500",
    "accessReviewSettings": null,
    "requestorSettings": {
        "scopeType": "AllExistingDirectorySubjects",
        "acceptRequests": true,
        "allowedRequestors": []
    },
    "requestApprovalSettings": {
        "isApprovalRequired": false,
        "isApprovalRequiredForExtension": false,
        "isRequestorJustificationRequired": false,
        "approvalMode": "NoApproval",
        "approvalStages": []
    },
    "customExtensionStageSettings": [
        {
            "id": "5a38d27a-b702-48d9-ac72-dcf158ba1b0d",
            "stage": "assignmentRequestCreated",
            "customExtension": {
                "@odata.type": "#microsoft.graph.accessPackageAssignmentRequestWorkflowExtension",
                "id": "219f57b6-7983-45a1-be01-2c228b7a43f8",
                "displayName": "test_action_1",
                "description": "Test logic app",
                "createdDateTime": "2022-01-11T05:19:16.97Z",
                "lastModifiedDateTime": "2022-01-11T05:19:16.97Z",
                "endpointConfiguration": {
                    "@odata.type": "#microsoft.graph.logicAppTriggerEndpointConfiguration",
                    "subscriptionId": "38ab2ccc-3747-4567-b36b-9478f5602f0d",
                    "resourceGroupName": "resourcegroup",
                    "logicAppWorkflowName": "customextension_test",
                    "url": "https://prod-31.eastus.logic.azure.com:443/workflows/8ccffea766ae48e680gd9a22d1549bbc/triggers/manual/paths/invoke?api-version=2016-10-01"
                },
                "authenticationConfiguration": {
                    "@odata.type": "#microsoft.graph.azureAdPopTokenAuthentication"
                }
            }
        }
    ],
    "verifiableCredentialSettings": {
        "credentialTypes":[{
            "issuers": ["did:ion:EiAlrenrtD3Lsw0GlbzS1O2YFdy3Xtu8yo35W<SNIP>..."],
            "credentialType": "VerifiedCredentialExpert"
        }]
    }
}