The sample is described in the following topics:
This sample demonstrates how to create and launch your own application that calls WSO2 Carbon user management APIs and saves/deletes users to/from the LDAP user stores of App Factory.
Set up App Factory using the instructions given in section Getting Started.
Executing the sample
- Log in to the App Factory portal, and create a new Web application by clicking Add New Application.
- Install GIT in your environment.
Copy the Repository URL that appears on the application's Overview page and create a folder in your machine to check out the code to.
Using the command prompt, navigate to the location where you want to check out the code to and ch eck out the application's source code as follows:
The code is cloned inside a folder by the name of the application. Open the pom.xml file in the folder and copy the values of the following elements:
- Copy the sample files found in
<AF_HOME>/samples/UserRealmSample/directory. You can also find the same content here: samples/UserRealmSample Choose to replace all files if asked.
- After copying files, open the new pom.xml file in the folder and set the values of
<packaging>elements to the values you copied in step 5.
Add, commit and push your changes to the remote repository using the following commands:
By default, applications are automatically built and deployed when a commit happens.
Go to the Repositories and Builds tab and click the Launch button to start the application. The application starts as follows:
Shown below is how the sample userstore-manager.jsp file calls the user manager APIs.
You can add/delete users and roles to/from the system using this application.