By: Joel Potts user 04 Jul 2016 at 4:58 a.m. CDT

4 Responses
Joel Potts gravatar
When creating a user with SCIM that user is not active and cannot be used to get access tokens. I can manually activate that user through GLUU. In the JSON used to create the user I use: ``` "active": "true" ``` However, this sets the User Status for the user to "true" rather than "active", unlike users that are manually created in GLUU which have the user status set to "active" automatically. If I send the JSON with: ``` "active": "active" ``` Then the value is ignored and the created user is not given a user status. Is there a way to automatically activate users created with SCIM? Thanks.

By Valentino Pecaoco user 04 Jul 2016 at 8:27 a.m. CDT

Valentino Pecaoco gravatar
Hi Joel, If you are using SCIM 2.0, this is a known bug since v2.4.2. This will be fixed in v2.4.4. [On SCIM user creation, value of "gluuStatus" attribute should be "active" and not "true"](https://github.com/GluuFederation/oxTrust/issues/240) If you are using SCIM 1.1, you can automatically activate the user by adding "gluuStatus = active" during user creation: ``` // Activate ScimCustomAttributes scimCustomAttributes = new ScimCustomAttributes(); scimCustomAttributes.setName("gluuStatus"); scimCustomAttributes.setValues(Arrays.asList(new String[]{"active"})); scimPerson.setCustomAttributes(Arrays.asList(scimCustomAttributes)); ```

By Joel Potts user 04 Jul 2016 at 10:19 a.m. CDT

Joel Potts gravatar
Hi, I believe I am using SCIM 1.1 (gluu.scim..., rather than gluu.scim2...). I tried including this in my json: ``` "customAttributes": [ { "name": "gluuStatus", "values": [ "active" ] } ] ``` Which had no effect, and in my custom scripts (Configuration>Manage Custom Scripts>User Registration) I have set "enable user" to true. Where should I be using the above suggested Java code to activate the user? Thanks. **EDIT** For reference, this is how I am currently creating the user: ``` ScimClient client = getClient(); ScimResponse res = client.createPersonString(prop_json,"application/json"); ``` Where prop_json, is the json properties file that is used to create the user.

By Valentino Pecaoco user 04 Jul 2016 at 9:17 p.m. CDT

Valentino Pecaoco gravatar
You can check [SCIM 1.1 unit tests in SCIM-Client](https://github.com/GluuFederation/SCIM-Client/tree/version_2.4.3/src/test/java/gluu/scim/client). > and in my custom scripts (Configuration>Manage Custom Scripts>User Registration) I have set "enable user" to true. This is not called by SCIM (although script support for SCIM will be added in v2.4.4).

By Joel Potts user 05 Jul 2016 at 3:39 a.m. CDT

Joel Potts gravatar
Hi, Thank you, I've got everything working now. It worked as you suggested, I just had to create a ScimPerson object from the JSON and use that to create a person, rather than using the JSON to create a person.