Hi Xavaier,

I could run the steps you have mentioned above without any issue in my IS
5.1.0 setup.

In your case it seems like the issue is in your step 3 (Create second
user). There you have intended to create a user, but has sent  a GROUP POST
request to SCIM group endpoint, so there it will create a group not a user.
So there is no user with id '1b97b894-5cbe-4b39-b6ce-9606debc5a28'. This is
why your requests are failing. Please check that, it will fix your issue.

Thank You!

On Mon, Jan 25, 2016 at 10:26 PM, Xavier Pegenaute M2M <
xavier.pegena...@m2mcloudfactory.com> wrote:

> Hi again,
>
> first, thanks a lot for your previous answers. This time I had some
> problem updating a group when it has already some member. My steps are
> shown below:
>
> *1) Create a first user*
> curl -k --user admin:admin --data
> "{"schemas":[],"name":{"familyName":"John","givenName":"Doe"},"userName":'groupUSR001',"password":"testPwd123"}"
> --header "Content-Type:application/json"
> https://localhost:9443/wso2/scim/Users
>
> {"id":"9b0585d0-646e-4eee-9d8a-342203540510","schemas":["urn:scim:schemas:core:1.0"],"name":{"familyName":"John","givenName":"Doe"},"userName":"groupUSR001","meta":
> {"lastModified":"2016-01-25T08:50:55","location":
> "https://localhost:9443/wso2/scim/Users/9b0585d0-646e-4eee-9d8a-342203540510";
> <https://localhost:9443/wso2/scim/Users/9b0585d0-646e-4eee-9d8a-342203540510>
> ,"created":"2016-01-25T08:50:55"}}
>
> *2) Create a group with a member*
> curl -k --user admin:admin --data "{"displayName": 'ngioletGR', "members":
> [{"value": "9b0585d0-646e-4eee-9d8a-342203540510", "display":
> "groupUSR001"}]}" --header "Content-Type:application/json"
> https://localhost:9443/wso2/scim/Groups
>
>
> {"id":"1b97b894-5cbe-4b39-b6ce-9606debc5a28","schemas":["urn:scim:schemas:core:1.0"],"displayName":"PRIMARY/ngioletGR","members":[{"value":"9b0585d0-646e-4eee-9d8a-342203540510","display":"groupUSR001"}],"meta":{"lastModified":"2016-01-25T08:59:49","created":"2016-01-25T08:59:49","location":
> "https://localhost:9443/wso2/scim/Groups/1b97b894-5cbe-4b39-b6ce-9606debc5a28";
> <https://localhost:9443/wso2/scim/Groups/1b97b894-5cbe-4b39-b6ce-9606debc5a28>
> }}
>
> *3) Create a second user*
> curl -k --user admin:admin --data "{"displayName": 'ngioletGR2',
> "members": [{"value": "9b0585d0-646e-4eee-9d8a-342203540510", "display":
> "groupUSR001"}]}" --header "Content-Type:application/json"
> https://localhost:9443/wso2/scim/Groups
>
>
> {"id":"1b97b894-5cbe-4b39-b6ce-9606debc5a28","schemas":["urn:scim:schemas:core:1.0"],"displayName":"PRIMARY/ngioletGR2","members":[{"value":"9b0585d0-646e-4eee-9d8a-342203540510","display":"groupUSR001"}],"meta":{"lastModified":"2016-01-25T08:59:49","created":"2016-01-25T08:59:49","location":
> "https://localhost:9443/wso2/scim/Groups/1b97b894-5cbe-4b39-b6ce-9606debc5a28";
> <https://localhost:9443/wso2/scim/Groups/1b97b894-5cbe-4b39-b6ce-9606debc5a28>
> }}
>
>
> *3a) PATCH group to add the last user*
> curl -k -X PATCH --user admin:admin --data "{"displayName": 'ngioletGR',
> "members": [{"value": "9b0585d0-646e-4eee-9d8a-342203540510", "display":
> "groupUSR001"}, {"value": "1b97b894-5cbe-4b39-b6ce-9606debc5a28",
> "display": "groupUSR002"}]}" --header "Content-Type:application/json"
> https://localhost:9443/wso2/scim/Groups/1b97b894-5cbe-4b39-b6ce-9606debc5a28
>
> *{"Errors":[{"description":"User: 1b97b894-5cbe-4b39-b6ce-9606debc5a28
> doesn't exist in the user store. Hence, can not update the group:
> ngioletGR","code":"500"}]}*
>
> *3b) PUT group **to add the last user*
> curl -k -X PUT --user admin:admin --data "{"displayName": 'ngioletGR',
> "members": [{"value": "9b0585d0-646e-4eee-9d8a-342203540510", "display":
> "groupUSR001"}, {"value": "1b97b894-5cbe-4b39-b6ce-9606debc5a28",
> "display": "groupUSR002"}]}" --header "Content-Type:application/json"
> https://localhost:9443/wso2/scim/Groups/1b97b894-5cbe-4b39-b6ce-9606debc5a28
>
> *{"Errors":[{"description":"Error occurred while updating old group :
> PRIMARY/ngioletGR","code":"500"}]}*
>
>
> Am I wrong in some step?, I am using IS 5.1
>
> Best regards,
> Xavi
>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Chamila Dilshan Wijayarathna,*
Software Engineer
Mobile:(+94)788193620
WSO2 Inc., http://wso2.com/
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to