2

我正在尝试在 AAD 中实现 SCIM,并且很难映射字段。将用户添加到组时。在此示例中,我希望发生以下情况:

(几乎是 scim 所做的)

  1. 提供用户,创建用户。

  2. 用户取消配置,用户已删除

  3. 用户添加到组,组更改

  4. 用户从组中删除,组更改。

这是api信息

获取用户

方法:get

网址:/scim/v2/Users?filter=userName+eq+%22example%40example.com%22

回复:

{
    "totalResults": 1,
    "startIndex": 1,
    "itemsPerPage": 1,
    "schemas": [ "urn:ietf:params:scim:api:messages:2.0:ListResponse" ],
    "Resources": [
        {
            "emails": [ { "value": "example@example.com" } ],
            "appGroups": [ "Unicorn Team" ],
            "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:User" ],
            "name": { "familyName": "Family", "givenName": "Given" }, // SCIM requires names, but no real names are stored; you'll always get back these placeholder values
            "active": true,
            "id": "example@example.com",
            "userName": "example@example.com",
            "status": "success"
        },
        ... // more users
    ]
}

添加用户

方法: post

网址 /scim/v2/Users

身体

{
  "userName": "example@example.com",
  "appGroups": [ "Unicorn Team", "Rainbow Team" ],
  "active": true
}

回复:

{
    "emails": [
        {
            "value": "example@example.com"
        }
    ],
    "appGroups": [
        "Unicorn Team", 
        "Rainbow Team"

    ],
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "name": {
        "familyName": "Family",
        "givenName": "Given"
    },
    "active": true,
    "id": "example@example.com",
    "userName": "example@example.com",
    "status": "success"
}

用户配置:

 "users": [
    {
      "email": "example@example.com",
      "groups": ["Unicorn Team", "Rainbow Team"]
    },
],
"groups": [
    {
      name: "Unicorn Team",
    },
    {
      name: "Rainbow Team",
    },
    {
      name: "X",
    },
    {
      name: "Y",
    },
    {
      name: "Z",
    },
 ]

putUsers

方法:put

网址:/scim/v2/Users/example%40example.com

身体:

{
  "userName": "example@example.com",
  "appGroups": [ "Unicorn Team", "X" ],
  "active": true
}

用户配置:

 "users": [
    {
      "email": "example@example.com",
      "groups": ["Unicorn Team", "X"]
    },
],
"groups": [
    {
      name: "Unicorn Team",
    },
    {
      name: "Rainbow Team",
    },
    {
      name: "X",
    },
    {
      name: "Y",
    },
    {
      name: "Z",
    },
 ]

补丁用户

方法:patch

网址:/scim/v2/Users/example%40example.com

身体:

{
  "active": false
}

回复:

{
    "emails": [
        {
            "value": "example@example.com"
        }
    ],
    "appGroups": [
        "Unicorn Group"
    ],
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
    ],
    "name": {
        "familyName": "Family",
        "givenName": "Given"
    },
    "active": false,
    "id": "example@example.com",
    "userName": "example@example.com",
    "status": "success"
}

用户配置

 "users": [

],
"groups": [
    {
      name: "Unicorn Team",
    },
    {
      name: "Rainbow Team",
    },
    {
      name: "X",
    },
    {
      name: "Y",
    },
    {
      name: "Z",
    },
 ]

Azure 文档: https ://docs.microsoft.com/en-us/azure/active-directory/app-provisioning/use-scim-to-provision-users-and-groups

4

1 回答 1

0

为了在 SCIM AZURE AD 实现中将用户添加到组,您必须实现 /Groups 端点,如下所示:
https ://docs.microsoft.com/en-us/azure/active-directory/app-provisioning/use -scim-to-provision-users-and-groups#update-group-add-members HTTP 补丁请求,如参考中所示。

于 2021-11-30T22:33:59.873 回答