wso2scim2wso2-identity-server

WSO2 5.10 SCIM API doesnt send email when creating user with askpassword set to true


I'm testing WSO2 5.10 user creation via SCIM Rest API using the following curl command

curl -v -k --user admin:admin --data "{"schemas":[],"name":{"familyName":"Smith","givenName":"John"},"userName":"john","password":"password","emails":[{"primary":true,"value":"jsmith@test.com","type":"home"},{"value":"jsmith@test.com","type":"work"},{"value":"jsmith@test.com"}],"EnterpriseUser":{askPassword:"true"}}" --header "Content-Type:application/json" https://localhost:9443/scim2/Users 

It creates a user as expected but doesn't send an email to set up a password. However, when an admin tries to create a user through the management console for the same scenario, the user receives an email to set up a password. But not through this API request.

What am I doing wrong?


Solution

  • You need to set the askPassword attribute under the urn:ietf:params:scim:schemas:extension:enterprise:2.0:User schema as true in the SCIM2 user create request. So try the request as below,

    curl -v -k --user admin:admin --data '{"schemas":[],"name":{"familyName":"Smith","givenName":"John"},"userName":"john","password":"password","emails":[{"primary":true,"value":"jsmith@test.com","type":"home"},{"value":"jsmith@test.com","type":"work"},{"value":"jsmith@test.com"}],"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{askPassword:"true"}}' --header "Content-Type:application/json" https://localhost:9443/scim2/Users
    

    Please refer the official documentation for more details.