首页 > 解决方案 > 未添加帐户锁定属性以响应 wso2 中的 scim2 GET 用户 API

问题描述

我正在尝试检索在 WSO2 IS 5.9 版本中已锁定帐户的用户列表。在将帐户锁定属性添加到以下声明后,我尝试了:

我也按照以下 URL 添加了自定义声明: https ://is.docs.wso2.com/en/5.9.0/develop/extending-scim2-user-schemas/

{ "attributeURI":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:accountLock",
 "attributeName":"accountLock",
 "dataType":"boolean",
 "multiValued":"false",
 "description":"Account lock",
 "required":"false",
 "caseExact":"false",
 "mutability":"readwrite",
 "returned":"default",
 "uniqueness":"none",
 "subAttributes":"null",
 "multiValuedAttributeChildName":"null",
 "canonicalValues":[],
"referenceTypes":[]
}

但是我仍然无法获取 accountLock 属性以响应 scim2 的 GET Users API。

回复

   “总结果”:10,
   “开始索引”:1,
   “itemsPerPage”:10,
   “模式”:[
       “urn:ietf:params:scim:api:messages:2.0:ListResponse”
   ],
   “资源”: [
       
       {
           “电子邮件”:[
               “divya@abc.com”
           ],
           “元”:{
               “创建”:“2020-06-25T07:49:35.465Z”,
               "lastModified": "2020-06-25T11:20:13.482Z",
               “资源类型”:“用户”
           },
           “姓名”: {
               "givenName": "客人",
               “familyName”:“客人”
           },
           “组”:[
               {
                   “显示”:“应用程序/sp1”
               },
               {
                   “显示”:“应用程序/sp2”
               },
               {
                   “显示”:“应用/读取”
               }
           ],
           “id”:“9ffbed2e-3703-470c-a2c8-e738f4c09709”,
           “用户名”:“guest12”
       }
   ]}```

标签: wso2wso2is

解决方案


以下原因可能会导致 accoutLock 属性未出现在 SCIM2 GET 用户响应中。

  1. 您可能错过了添加新属性 ("urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:accountLock")作为urn:ietf:params:scim:schemas:extension:enterprise 的子属性: 2.0:用户对象。(https://is.docs.wso2.com/en/5.9.0/develop/extending-scim2-user-schemas/#extending-the-scim-20-api中的第 3 点。“subAttributes”:“ accoutLock verifyEmail问密码员工人数成本中心组织部部门经理")

      "attributeURI":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User",
      "attributeName":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User",
      “数据类型”:“复杂”,
      “多值”:“假”,
      "description":"企业用户",
      “必需”:“假”,
      "caseExact":"假",
      “可变性”:“读写”,
      “返回”:“默认”,
      “唯一性”:“无”,
      "subAttributes":"acoutLock verifyEmail askPasswordemployeeNumbercostCenter组织部部门经理",
      “规范值”:[],
      “referenceTypes”:[“外部”]
      }```
    
    
  2. 添加的自定义声明(https://is.docs.wso2.com/en/5.9.0/develop/extending-scim2-user-schemas/#add-the-custom-claim)的映射属性应该是现有的如果您使用默认 LDAP 用户存储,则 LDAP 模式中的属性。(但是,如果您犯了这个错误,您将无法更新/添加索赔价值。它会给出One or more attributes you are trying to add/update are not supported by underlying LDAP for user:错误)

  3. SCIM2 GET 用户的响应不包含没有值的属性。因此,将 true/false 设置为声明值。

此外,将新属性添加到 urn:ietf:params:scim:schemas:extension:enterprise:2.0:User claim dialect 就足够了。按照https://is.docs.wso2.com/en/5.9.0/develop/extending-scim2-user-schemas/中的步骤操作


推荐阅读