WSO2is SCIM 2使用自定义字段创建新用户

WSO2is SCIM 2使用自定义字段创建新用户,wso2,wso2is,scim,Wso2,Wso2is,Scim,我可以根据以下示例创建新用户: curl-v-k——用户admin@tenant1.com@tenant1.com:admin--data'{“schemas”:[],“name”:{“familyName”:“jackson”,“givenName”:“kim”},“PhoneNumber”:[{“type”:“mobile”,“value”:“9999”}],“addresses”:[{“type”:“work”,“streetAddress”:“100环球城市广场”,“Location”:

我可以根据以下示例创建新用户:

curl-v-k——用户admin@tenant1.com@tenant1.com:admin--data'{“schemas”:[],“name”:{“familyName”:“jackson”,“givenName”:“kim”},“PhoneNumber”:[{“type”:“mobile”,“value”:“9999”}],“addresses”:[{“type”:“work”,“streetAddress”:“100环球城市广场”,“Location”:“Hollywood”,“region”:“CA”,“postalCode”:“90068”,“country”:“USA”,“formatted”:”:“美国加利福尼亚州霍利伍德环球城市广场100号,邮编90068”,“主要”:true},{“类型”:“家”,“街道地址”:“456好莱坞大道”,“地点”:“好莱坞”,“地区”:“加利福尼亚州”,“邮编”:“91608”,“国家”:“美国”,“格式”:“456好莱坞大道\n加利福尼亚州霍利伍德91608美国”},,“用户名”:”kim@mail.com“,”密码“:”kimwso2“,”昵称“:”abc“,”头衔“:”运营总监“,”urn:ietf:params:scim:schemas:core:2.0:User:streetAddress:“迈阿密,佛罗里达”,“电子邮件”:[{“主要”:true,“值”:“kim”。jackson@gmail.com,“type”:“home”},{“value”:“kim”_j@wso2.com,“类型”:“工作”}]}'--header“内容类型:应用程序/json”https://localhost:9443/t/tenant1.com/scim2/Users
我想向新用户添加对
部门
字段的支持

urn:ietf:params:scim:schemas:extension:enterprise:2.0:User
的索赔中,我已确保索赔部门与
http://wso2.org/claims

添加了部门的脚本

curl-v-k——用户admin@tenant1.com@tenant1.com:admin--data'{“schemas”:[],“name”:{“familyName”:“jackson”,“givenName”:“kim”},“PhoneNumber”:[{“type”:“mobile”,“value”:“9999”}],“addresses”:[{“type”:“work”,“streetAddress”:“100环球城市广场”,“Location”:“Hollywood”,“region”:“CA”,“postalCode”:“90068”,“country”:“USA”,“formatted”:”美国加利福尼亚州霍利伍德环球城市广场100号,邮编90068,“主”:true},{“类型”:“家”,“街道地址”:“456好莱坞大道”,“地点”:“好莱坞”,“地区”:“CA”,“邮电代码”:“91608”,“国家”:“美国”,“格式化”:“456好莱坞大道\n加利福尼亚州霍利伍德91608美国”},“部门”:[“会计”,“营销和广告”],“用户名”:kim@mail.com,“密码”:kimwso2,“昵称”:“abc”,“标题”:“bhhhxxs”,“urn:ietf:params:scim:schemas:core:2.0:User:streetAddress”:“bhhhxxs”,“电子邮件”:[{“primary”:true,“value”:“kim”。jackson@gmail.com,“type”:“home”},{“value”:“kim”_j@wso2.com,“类型”:“工作”}]}'--header“内容类型:应用程序/json”https://localhost:9443/t/tenant1.com/scim2/Users
如果我向脚本中添加department字段,则在请求此用户id时创建但不返回:

curl-v-k--user的结果admin@tenant1.com@租户1.com:adminhttps://localhost:9443/t/tenant1.com/scim2/Users/44c7b532-09fe-4530-a199-cf81bff95b3a | jq.

{
    "emails": [{
            "type": "work",
            "value": "kim_j@wso2.com"
        },
        {
            "type": "home",
            "value": "kim.jackson@gmail.com"
        }
    ],
    "addresses": [{
            "type": "work",
            "value": "100 Universal City Plaza\nHollywood, CA 90068 USA"
        },
        {
            "type": "home",
            "value": "456 Hollywood Blvd\nHollywood, CA 91608 USA"
        }
    ],
    "meta": {
        "created": "2020-04-08T12:46:30.549Z",
        "location": "https://localhost:9443/t/tenant1.com/scim2/Users/44c7b532-09fe-4530-a199-cf81bff95b3a",
        "lastModified": "2020-04-08T12:46:30.549Z",
        "resourceType": "User"
    },
    "nickName": "abc",
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User",
        "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
    ],
    "roles": [{
        "type": "default",
        "value": "Internal/everyone"
    }],
    "name": {
        "givenName": "kim",
        "familyName": "jackson"
    },
    "id": "44c7b532-09fe-4530-a199-cf81bff95b3a",
    "userName": "kim@mail.com",
    "title": "bhhhxxs",
    "phoneNumbers": [{
        "type": "mobile",
        "value": "9999"
    }]
}
我已经阅读了这些文档,但没有成功:
https://is.docs.wso2.com/en/latest/develop/extensible-scim-user-schemas-with-wso2-identity-server/#extensible-scim-user-schemas-with-wso2-identity-server

https://is.docs.wso2.com/en/latest/develop/extending-scim2-user-schemas/#extending--scim-20-api


我的设置:wso2is 5.10

您可以在中找到创建具有扩展模式属性的用户的示例请求

诀窍是在create请求中表示扩展属性,如下所示

"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
    "department": [
        "Accounting",
        "Marketing and Advertising"
    ]
}

更新:默认情况下,urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department不是服务器中定义的scim2架构中的多值属性。您可以通过编辑is_HOME/repository/conf/scim2-schema-extension.config文件使其成为多值属性,从而使其成为多值属性

{
"attributeURI":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department",
"attributeName":"department",
"dataType":"string",
"multiValued":"true",
"description":"Identifies the name of a department",
"required":"false",
"caseExact":"false",
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none",
"subAttributes":"null",
"canonicalValues":[],
"referenceTypes":[]
}

请注意“multiValue”属性是如何更新的。

您可以在

诀窍是在create请求中表示扩展属性,如下所示

"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
    "department": [
        "Accounting",
        "Marketing and Advertising"
    ]
}

更新:默认情况下,urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department不是服务器中定义的scim2架构中的多值属性。您可以通过编辑is_HOME/repository/conf/scim2-schema-extension.config文件使其成为多值属性,从而使其成为多值属性

{
"attributeURI":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department",
"attributeName":"department",
"dataType":"string",
"multiValued":"true",
"description":"Identifies the name of a department",
"required":"false",
"caseExact":"false",
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none",
"subAttributes":"null",
"canonicalValues":[],
"referenceTypes":[]
}

注意“multiValue”属性是如何更新的。

Hello@farasath,我尝试了这个技巧,将这个属性添加到了我的实际curl中,但是我有一个错误:
{“schemas”:[“urn:ietf:params:scim:api:messages:2.0:error”],“scimType”:“invalidSyntax”,“detail”:“请求不可解析,语法不正确,或者违反了模式”,“status”:“400”}
默认情况下,urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department不是架构中的多值属性。这可能是您在尝试将多值设置为属性时出错的原因。我已更新了答案。在修复多值属性属性后似乎可以工作谢谢!现在可以了,我认为wso2 d文档应该更好。我在wso2 5.6.0中也有类似的问题。我已经在scim2配置文件
accountDisable
中映射了一个新属性,并且还映射到了本地声明
../claims/identity/accountDisabled
当使用scim2 get调用时,响应没有得到这个属性,您可以创建一个新问题吗detailsHello@farasath,我尝试了这个技巧,在我的实际curl中添加了这个属性,但是我有一个错误:
{“schemas”:[“urn:ietf:params:scim:api:messages:2.0:error”],“scimType”:“invalidSyntax”,“detail”:“请求不可解析,语法不正确,或者违反了schema。”,“status”:“400”}
默认情况下,urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department不是架构中的多值属性。这可能是您在尝试将多值设置为属性时出错的原因。我已更新了答案。在修复多值属性属性后似乎可以工作谢谢!现在可以了,我认为wso2 d文档应该更好。我在wso2 5.6.0中遇到了类似的问题。我已经在scim2配置文件
accountDisable
中映射了一个新属性,并且还映射到了本地声明