1
votes

I want to customize the data that get stored when creating a new user in WSO2 Identity server using rest API.

below is the sample json given in their official site

https://docs.wso2.com/display/IS570/apidocs/SCIM2-endpoints/#!/operations#UsersEndpoint#createUser

I want to add some custom fields like address, phone, etc

{
"schemas":[],
"name":{"familyName":"jackson","givenName":"kim"},
"userName":"dhanu",
"password":"abc@123",
"emails":[{"primary":true,"value":"[email protected]","type":"home"}, 
{"value":"[email protected]","type":"work"}]

 }

I tried by changing the above json. but it do not take additional parameters in. Please assist me to find a way

1

1 Answers

0
votes

if you want to dd some custom fields like address, phone, please refer to Management Console

Home> Identity> Claims > List > urn:ietf:params:scim:schemas:core:2.0:User

Here you will find all the attributes that you can add as claims using SCIM2 API in the user creation For your requirement you can use a request with a body as follows. If you want more claims other than them you can Extend the SCIM API[1] add any custom attributes, you can use the user schema extension in addition to core user schema.

{
"schemas":[
],
"name":{
"familyName":"jackson",
"givenName":"kim"
},
"phoneNumbers":[
{
"type":"mobile",
"value":"9999"
}
],
"addresses":[
{
"type":"work",
"streetAddress":"100 Universal City Plaza",
"locality":"Hollywood",
"region":"CA",
"postalCode":"90068",
"country":"USA",
"formatted":"100 Universal City Plaza\nHollywood, CA 90068 USA",
"primary":true
},
{
"type":"home",
"streetAddress":"456 Hollywood Blvd",
"locality":"Hollywood",
"region":"CA",
"postalCode":"91608",
"country":"USA",
"formatted":"456 Hollywood Blvd\nHollywood, CA 91608 USA"
}
],
"userName":"kim",
"password":"kimwso2",
"nickName":"abc",
"title":"bhhhxxs",
"urn:ietf:params:scim:schemas:core:2.0:User:streetAddress":"bhhhxxs",
"emails":[
{
"primary":true,
"value":"[email protected]",
"type":"home"
},
{
"value":"[email protected]",
"type":"work"
}
]
}

[1].https://docs.wso2.com/display/ISCONNECTORS/Configuring+SCIM+2.0+Provisioning+Connector

Thanks

Buddhima