1

Hi I use wso2is version 5.4.1 as identity server.

I want to create user using scim2 api. When user is created, an email is sent to the user and he will be able to click on a link recieved in email and through the link he will be able to change password - that is what I mean with askPassword user as specified here: https://docs.wso2.com/display/IS541/Creating+Users+Using+the+Ask+Password+Option

First option (WORKS) how to create user using WSO2 managment console

enter image description here

This scenario works and email is sent.

Second option (DOESN'T WORK) how to create user using SCIM2

curl -v -k --user admin:admin --data {"schemas":[],"name":{"familyName":"Smith","givenName":"Paul"},"userName":"Test","password":"password","emails":[{"primary":true,"value":"Test@abc.com","type":"home"},{"value":"paulSmith@abc.com","type":"work"}],"EnterpriseUser":{askPassword:"true"}} --header "Content-Type:application/json" https://mylink:port/scim2/Users

Wso2is console outputs:

enter image description here

Community
  • 1
  • 1
dtechlearn
  • 363
  • 2
  • 4
  • 21

2 Answers2

0

You need to send the askPassword attribute within double quoation marks.

e.g

curl -v -k --user admin:admin --data {"schemas":[],"name":{"familyName":"Smith","givenName":"Paul"},"userName":"Test","password":"password","emails":[{"primary":true,"value":"Test@abc.com","type":"home"},{"value":"paulSmith@abc.com","type":"work"}],"EnterpriseUser":{"askPassword":"true"}} --header "Content-Type:application/json" https://mylink:port/scim2/Users

Please check with the above request.

If the above does not work check whether the following property is available in {Server_Home}/repository/conf/identity/identity.xml file under < EventListeners> tag

<Property name="Data.Store">org.wso2.carbon.identity.governance.store.JDBCIdentityDataStore</Property
sathya
  • 523
  • 1
  • 4
  • 18
  • No, this is not problem, even if I had it with quotes still the same response and btw... it would throw different error. – dtechlearn May 02 '18 at 11:58
  • can you post the full console log with stack-trace? – sathya May 02 '18 at 13:37
  • Also check whether the following property is there in /repository/conf/identity/identity.xml file under tag .. org.wso2.carbon.identity.governance.store.JDBCIdentityDataStore – sathya May 02 '18 at 13:49
0

Works for version 5.6.0. It is necessary to to fill proper property for email address... {"value":"email@gmail.com"} if this is not set, then I get error : Error occurred while accessing Java Security Manager Privilege Block

{"schemas":[],
 "name":{"familyName":"Smith","givenName":"Paul"},
 "userName":"test110",
 "password":"password",
 "emails":[{"primary":true,"value":"email@gmail.com","type":"home"}, 
           {"value":"email@gmail.com","type":"work"},
           {"value":"email@gmail.com"}],
 "EnterpriseUser":{"askPassword":"true"},
}
dtechlearn
  • 363
  • 2
  • 4
  • 21