This sample demonstrates how to consume SCIM Rest Endpoints in WSO2 Identity Server from a JAVA client application based on HttpClient.
Step 1: Steps to run the sample:
Start the Identity Server, using the startup script found in the
[IS_Home]/bin
folder.Use wso2server.sh for Linux and wso2server.bat for Windows.
- Make sure you have installed Apache Ant.
- Refer to the client.properties file for SCIM user endpoint, group endpoint URLs, username and password.
- Modify it if the default configuration to run the sample is different.
Step 2: Sample for creating a user:
- Run the command: 'ant create-user' at this directory level in the command line and observe the JSON message sent to the SCIM endpoint. The response status and the SCIM response are printed in the command line output.
- The new user is created in Identity Server.
- If you wish, you can modify the org.wso2.scim.sample.user.CreateUser class to add more attributes to the created user and observe the output in the command line.
Step 3: Sample for creating a group:
- Run the command: 'ant create-user' at this directory level in the command line and observe the JSON message sent to the SCIM endpoint. The response status and the SCIM response are printed in the command line output.
- The new group is created in the Identity Server and the user created in Step 2 is added to the group.
Step 4: Sample for updating user identity information:
- Run the command: 'ant update-user' at this directory level in command line and observe the json message sent to the SCIM endpoint, the response status and the SCIM response are printed in the command line output.
- The user created in the Step 2 is updated with new attribute values for: display name and work email. If you wish, you can modify the org.wso2.scim.sample.user.UpdateUser class to add more attributes to user and observe the output in the command line.
Step 5: Sample for updating group:
- Run the command: 'ant update-group' at this directory level in command line and observe the json message sent to the SCIM endpoint, the response status and the SCIM response are printed in the command line output.
- You will notice that the group created in the step 5 above, is updated with new attribute values for: display name.
Step 6: Sample for deleting user:
- Run the command: 'ant delete-user' at this directory level in command line and observe the response status and the SCIM response printed in the command line output.
- The user created in Step 2 is now deleted in Identity Server.
Step 7: Sample for deleting group:
- Run the command: 'ant delete-group' at this directory level in command line and observe the response status and the SCIM response printed in the command line output. If the
- The group created in Step 3 is now deleted in Identity Server.
- Provisioning SCIM operations to other SCIM providers.
You can also observe the provisioning of above SCIM operations to other SCIM providers - such as other Identity Server nodes by configuring SCIM providers in the current Identity Server node, as described in the documentation which can be found here.