简体   繁体   English

如何在 wso2 中创建用户是通过 scim2 api 与外部声明&

[英]How create user in wso2 is via scim2 api with external claims&

I'am try to create user with external claims via scim2 api.我正在尝试通过 scim2 api 创建具有外部声明的用户。 First i create claim http://wso2.org/claims/inn首先我创建声明http://wso2.org/claims/inn 创建声明

Then i add claim to schema: urn:ietf:params:scim:schemas:extension:enterprise:2.0:User然后我向架构添加声明:urn:ietf:params:scim:schemas:extension:enterprise:2.0:User 添加架构声明

Finaly i sending request to create user:最后我发送创建用户的请求:

{
    "schemas": ["urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],
    "name": {
        "familyName": "TryAddClaims",
        "givenName": "rest11@test.com"
    },
    "userName": "rest11@test.com",
    "password": "admin",
    "emails": [{
            "primary": true,
            "value": "rest11@test.com",
            "type": "home"
        }
    ],
    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{
        "organization": "rest_organization",
        "inn": "inn"
    }
}

response:回复:

{
    "emails": [
        {
            "type": "home",
            "value": "rest11@test.com"
        },
        "rest11@test.com"
    ],
    "meta": {
        "created": "2022-09-12T07:43:20.474255Z",
        "location": "my-host/scim2/Users/1d64942c-ce24-48cf-ad47-665f4f9c37f8",
        "lastModified": "2022-09-12T07:43:20.474255Z",
        "resourceType": "User"
    },
    "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"
        },
        {
            "display": "everyone"
        }
    ],
    "name": {
        "givenName": "rest11@test.com",
        "familyName": "TryAddClaims"
    },
    "id": "1d64942c-ce24-48cf-ad47-665f4f9c37f8",
    "userName": "rest11@test.com",
    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
        "organization": "rest_organization"
    }
}

why inn not present in the response, but organization with same config is present?为什么 inn 没有出现在响应中,但存在具有相同配置的组织? In wso2 admin panel inn also empty for this user.在 wso2 管理面板中,该用户也为空。

Seems you have missed adding attribute definition to the scim2-schema-extension.config file located in the <IS_HOME>/repository/conf/ folder.似乎您错过了将属性定义添加到位于 <IS_HOME>/repository/conf/ 文件夹中的 scim2-schema-extension.config 文件。

Check Add an Attribute Definition section in https://medium.com/p/71621f62c5d3 or Refer to the official documentation: https://is.docs.wso2.com/en/5.9.0/develop/extending-scim2-user-schemas/#extending-the-scim-20-api Check Add an Attribute Definition section in https://medium.com/p/71621f62c5d3 or Refer to the official documentation: https://is.docs.wso2.com/en/5.9.0/develop/extending-scim2-user -schemas/#extending-the-scim-20-api

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM