By: Vipin Jain named 26 Jul 2017 at 12:28 a.m. CDT

12 Responses
Vipin Jain gravatar
Hello Team, We are trying to use SCIM for Get, Create, Update user operations and having issues with Get Users endpoint. Pointers will help. We have enabled SCIM in the Organization Configuration Below is the request which i am testing and i get no output. I am sending the Authorization Basic header with admin credentials. curl -X POST \ https://gluu.simeiolabs.com/identity/seam/resource/restv1/scim/v1/Users/ \ -H 'accept: application/json' \ -H 'authorization: Basic YWRtaW46MTIzNDU=' \ -H 'cache-control: no-cache'

By Mohib Zico staff 26 Jul 2017 at 2:52 a.m. CDT

Mohib Zico gravatar
One quick note.... We are using scim v2.

By Vipin Jain named 26 Jul 2017 at 3:28 a.m. CDT

Vipin Jain gravatar
Yes, we also tried with following URL and its not working https://<hostname>/identity/seam/resource/restv1/scim/v2/Users

By Mohib Zico staff 26 Jul 2017 at 5:31 a.m. CDT

Mohib Zico gravatar
Ok. Can you please check oxtrust.log what error it's throwing when you are initiating curl?

By Vipin Jain named 26 Jul 2017 at 8:58 a.m. CDT

Vipin Jain gravatar
Yes, i was able to get the error clear and getting new error. I am not able to create user, get below error, Can i get a sample SCIM request specific to Gluu POST Endpoint : https://<hostname>/identity/seam/resource/restv1/scim/v2/Users?access_token=afb0567e-69f2-46f0-b7c6-9a0bd3e3d661 JSON Object: "schemas":["urn:ietf:params:scim:schemas:core:2.0:User"], "userName":"bj1", "externalId":"bj22", "name":{ "formatted":"Ms. Barbara J Jensen III", "familyName":"Jensen", "givenName":"Barbara", "middleName":"Jane" }, "roles":[] } Output: <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 400 java.io.IOException: Unexpected processing error; please check the input parameters</title> </head> <body><h2>HTTP ERROR 400</h2> <p>Problem accessing /identity/seam/resource/restv1/scim/v2/Users. Reason: <pre> java.io.IOException: Unexpected processing error; please check the input parameters</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.3.15.v20161220</a><hr/> </body> </html>

By Mohib Zico staff 26 Jul 2017 at 9 a.m. CDT

Mohib Zico gravatar
>> Can i get a sample SCIM request specific to Gluu We are working to add something like these with curl in documentation. What oxtrust.log showing when you are trying to create this user? I am sure it will help Jose a lot.

By Vipin Jain named 26 Jul 2017 at 9:02 a.m. CDT

Vipin Jain gravatar
Below error 2017-07-26 10:01:53,104 INFO [qtp2008017533-18] [oxtrust.service.scim2.jackson.custom.UserDeserializer] (UserDeserializer.java:38) - deserialize() org.codehaus.jackson.map.JsonMappingException: Can not instantiate value of type [simple type, class org.gluu.oxtrust.model.scim2.User] from JSON String; no single-String constructor/factory method at org.codehaus.jackson.map.deser.std.StdValueInstantiator._createFromStringFallbacks(StdValueInstantiator.java:379)

By Mohib Zico staff 26 Jul 2017 at 9:05 a.m. CDT

Mohib Zico gravatar
Will be good if you can share full log; one line is hard to understand. Something like attached one.

By Jose Gonzalez staff 26 Jul 2017 at 9:06 a.m. CDT

Jose Gonzalez gravatar
Hi, Besides your log, can you please double-check you have followed the instructions shown [here](https://gluu.org/docs/ce/3.0.2/admin-guide/scim-uma/)?. A quick way to test SCIM v2 is OK is by enabling the test mode (scroll down in the page), that way you can make requests of the kind you mentioned in the beginning. Remember that SCIM does not require your admin user (indeed not an end-user at all). This is achieved by an already configured OpenId connect client that exists in your default Gluu CE instalation (its name is "SCIM Requesting Party Client") Ensure you have followed the steps there. We'll be happy to assist you

By shikha Mishra user 26 Jul 2017 at 9:25 a.m. CDT

shikha Mishra gravatar
Hi Jose, I am working with Vipin on SCIM. We have followed the instructions and using test mode.We are able to perform read and update operation using scim. Facing issue with Create Operation. oxtrust.log: 2017-07-26 09:54:34,647 ERROR [qtp2008017533-11] [gluu.oxtrust.ws.rs.scim2.UserWebService] (UserWebService.java:259) - PersonRequiredFieldsException: org.gluu.oxtrust.exception.PersonRequiredFieldsException: There are missing required parameters: userName, givenName, displayName, or familyName at org.gluu.oxtrust.util.CopyUtils2.isValidData(CopyUtils2.java:1059) ~[classes/:?] at org.gluu.oxtrust.util.CopyUtils2.copy(CopyUtils2.java:129) ~[classes/:?] at org.gluu.oxtrust.service.scim2.Scim2UserService.createUser(Scim2UserService.java:53) ~[classes/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_112] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:79) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) ~[jboss-seam-2.3.1.Final.jar:2.3.1.Final]

By Jose Gonzalez staff 30 Jul 2017 at 8:52 a.m. CDT

Jose Gonzalez gravatar
Hi Vipin and Shikha, I replicated your request on a fresh 3.0.2 installation. Your request is simply missing the `displayName` parameter and if included, should work fine. As Mohib suggested, I am preparing for the week coming a big update on the SCIM docs at gluu.org/docs that will include example requests of this kind so that you don't necessarily have to resort to the RFC specs... By now, here is a small excerpt that you will find useful for creating a user: ============= [...] To create our first dummy user, open a text editor and paste the following: ``` { "schemas":["urn:ietf:params:scim:schemas:core:2.0:User"], "userName":"ajsmith", "name":{ "familyName":"Smith", "givenName":"Joe", }, "displayName":"Average Joe" } ``` Save it to your local disk as `input.json` and open a command line interface (you don't need to login to Gluu's chroot). Issue this command replacing with proper values between angle brackets and if required, passing the path to your Gluu host SSL certificate: ``` $ curl --cacert /opt/gluu-server-<glu-version>/etc/certs/httpd.crt -H 'Content-Type: application/scim+json' -H 'cache-control: no-cache' -d @input.json -o output.json https://<host-name>/identity/seam/resource/restv1/scim/v2/Users?access_token=<test-mode-token> ``` After execution open the file `output.json`. You should see a response like this (some contents have been supressed): ``` { "id": "...", "meta": { "created": "...", "lastModified": "...", "location": "https://.../scim/v2/Users/@!..." "resourceType": "User" }, "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:User" ], "userName": "ajsmith", "name": { "formatted": "Joe Smith", "familyName": "Smith", "givenName": "Joe" }, "displayName": "Average Joe", ... } ``` This new user has been given an `id`. If possible inspect your `ou=people` branch and find the entry whose `inum` matches the `id` given. ============= For a next time issue, please include log in lower level (e.g. trace) Kind regards.

By Jose Gonzalez staff 31 Jul 2017 at 11:51 a.m. CDT

Jose Gonzalez gravatar
... as promised. Here you have [raw-http-requests](https://www.gluu.org/docs/ce/admin-guide/user-scim/#raw-http-requests) There are updates on that page as well as at [scim-uma](https://www.gluu.org/docs/ce/admin-guide/scim-uma/) page

By Vipin Jain named 31 Jul 2017 at 11:57 a.m. CDT

Vipin Jain gravatar
Thank you Jose. We did get it working late Friday evening. Will surely refer to your docs for any open questions. Thanks