cancel
Showing results for 
Search instead for 
Did you mean: 

create multi tenant user with home folder

msj4u
Champ in-the-making
Champ in-the-making
hi

i have successfully created the multi tenant users with following code


@Override
   public boolean createTenantUser(String domain, String username, String password, Map<String, String> properties) {
      logger.debug("creating tenant user");
      boolean createdUser = true;
      try {
         AuthenticationUtils.startSession( ("admin@" + domain), TENANT_ADMIN_PASSWORD);
         AdministrationServiceSoapPort userService = WebServiceFactory.getAdministrationService();
         NamedValue[] attributes = new NamedValue[] {
               new NamedValue(Constants.PROP_USER_FIRSTNAME, false, properties.get("firstName"), null),
               new NamedValue(Constants.PROP_USER_LASTNAME, false, properties.get("lastName"), null),
         };
         NewUserDetails newUserDetails = new NewUserDetails( (username + "@" + domain.toLowerCase()), password, attributes);
         NewUserDetails[] arrNewUserDetails = {newUserDetails};
         UserDetails[] createdUserDetails = userService.createUsers(arrNewUserDetails);
         logger.debug("created tenant user with details " + createdUserDetails);
      } catch (AuthenticationFault e) {
         logger.error(e.getMessage(), e);
         createdUser = false;
      } catch (Exception e) {
         logger.error(e.getMessage(), e);
         createdUser = false;
      } finally {
         AuthenticationUtils.endSession();
      }
      return createdUser;
   }


but the problem is that the home folder name is automatically set like 'user1@domain'; that was not desirable.

i wanted to create the home folder like the same as username

so i added the following code but that still didn't worked

new NamedValue(Constants.PROP_USER_HOMEFOLDER, false, ("/" + username), null),


can some body give me how to create a home folder with the same as username under user homes
1 REPLY 1

msj4u
Champ in-the-making
Champ in-the-making
okay if no one has idea about tenant

how to set the home folder "/Users Home/USER1" of the normal user "USER1"

using the same above code ?