Hi,

I am going to implement a third party web application for Users and roles
creation.

Below are the steps I carried out.

1. I have taken the same travelocity web app and customizing it adding a
form submission in the home which which loads after the login.
2. I have my jsp form with the correct servlet mapping.
3. In My method, I am trying to add a user role by referring the example
given in this doc [1]

[1] https://docs.wso2.com/display/IS520/Managing+Users+and+Roles+with+APIs

My Question is,

Without using the below approach to create a *ConfigurationContextFactory*
and authenticating the logged in user, what is the correct way to proceed
with my implementation? Since this is looking for the given
client.axis2.xml.

 try {
   configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
     "repo", "repo/conf/client.axis2.xml");
   authstub = new AuthenticationAdminStub(configContext, SERVER_URL
     + "AuthenticationAdmin");

   // Authenticates as a user having rights to add users.
   if (authstub.login("admin", "admin", null)) {
    cookie = (String)
authstub._getServiceClient().getServiceContext().getProperty(
      HTTPConstants.COOKIE_STRING);


In order to call the addRole method in UserStoreManager class, I need to
set correct value to the *realm*. Please correct me if my understanding is
wrong since I am not much familiar with this. Appreciate your advice.

*UserRealm realm = WSRealmBuilder.createWSRealm(SERVER_URL, cookie,
configContext); *
*    UserStoreManager storeManager = realm.getUserStoreManager(); *

Thanks,
-- 
*Ushani Balasooriya*
Associate Technical Lead - EE;
WSO2 Inc; http://www.wso2.com/.
Mobile; +94772636796
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to