Warm tip: This article is reproduced from serverfault.com, please click

WSO2 identity server: phone fields using SCIM don't accept numbers

发布于 2015-08-19 14:15:35

I'm using wso2 identity server version 5.0.0 with user store on mysql. When I try to insert user with phone numbers, the phone number are not stored.

curl -v -k --user admin:admin --data "{"schemas":[],"name":{"familyName":"Rossi","givenName":"Mario"},"userName":"rossiusr","password":"rossipsw","emails":"rossim@aaaa.it" ,"phoneNumbers":[{"value":"8811","type":"work"},{"value":"3473344555","type":"mobile"}]}" --header "Content-Type:application/json" https://localhost:9443/wso2/scim/Users

the result is:

Connection #0 to host localhost left intact
{"id":"f6ce5310-a2ee-4976-9579-0299029183bb","schemas":["urn:scim:schemas:core:1.0"],"name":{"familyName":"Rossi","givenName":"Mario"},"userName":"rossiusr","phoneNumbers":[{"type":"work"},{"type":"mobile"}],"emails":"rossim@aaaa.it","meta":{"lastModified":"2015-08-19T16:09:50","location":"https://192.168.3.43:9443/wso2/scim/Users/f6ce5310-a2ee-4976-9579-0299029183bb","created":"2015-08-19T16:09:50"}}

if I put a char in the phone number, it works fine:

curl -v -k --user admin:admin --data "{"schemas":[],"name":{"familyName":"Rossi","givenName":"Mario"},"userName":"rossiusr","password":"rossipsw","emails":"rossim@aaaa.it" ,"phoneNumbers":[{"value":"_8811","type":"work"},{"value":"_3473344555","type":"mobile"}]}" --header "Content-Type:application/json" https://localhost:9443/wso2/scim/Users

the result is:

Connection #0 to host localhost left intact
{"id":"3ce83aca-6f70-4274-a2c3-5429132d6001","schemas":["urn:scim:schemas:core:1.0"],"name":{"familyName":"Rossi","givenName":"Mario"},"userName":"rossiusr","phoneNumbers":[{"value":"_8811","type":"work"},{"value":"_3473344555","type":"mobile"}],"emails":"rossim@aaaa.it","meta":{"lastModified":"2015-08-19T16:12:50","location":"https://192.168.3.43:9443/wso2/scim/Users/3ce83aca-6f70-4274-a2c3-5429132d6001","created":"2015-08-19T16:12:50"}}

Why? a phone number... is a number!

Questioner
LukeT
Viewed
0
Dushani 2016-01-19 13:58:12

Phone number can be stored when enter the number within back slashes. Example : \"3473344555\"

Please find the modified curl command which works fine. curl -v -k --user admin:admin --data "{"schemas":[],"name":{"familyName":"Rossi","givenName":"Mario"},"userName":"rossiusr","password":"rossipsw","emails":"rossim@aaaa.it" ,"phoneNumbers":[{"value":\"8811\","type":"work"},{"value":\"3473344555\","type":"mobile"}]}" --header "Content-Type:application/json" https://localhost:9443/wso2/scim/Users

Result : {"id":"a5520dfc-aa7c-4b4b-aba2-57df7b87e2e4","schemas":["urn:scim:schemas:core:1.0"],"name":{"familyName":"Rossi","givenName":"Mario"},"userName": "rossiusr","phoneNumbers":[{"value":"8811","type":"work"},{"value":"3473344555","type":"mobile"}],"emails":"rossim@aaaa.it","meta":{"lastModified" :"2016-01-19T11:04:32","location":"https://localhost:9443/wso2/scim/Users/a5520dfc-aa7c-4b4b-aba2-57df7b87e2e4","created":"2016-01-19T11:04:32"}}* Connection #0 to host localhost left intact