cancel
Showing results for 
Search instead for 
Did you mean: 

ImpEx Created Employees - Can't Log In

Former Member
0 Kudos
749

ImpEx Created Employees - Can't Log In

I'm currently creating some Employee's by ImpEx:

 #Create Employees
 $passwordEncoding=md5
 $defaultPassword=1234
 $setPassword=@password[translator=de.hybris.platform.impex.jalo.translators.ConvertPlaintextToEncodedUserPasswordTranslator][default='$passwordEncoding:$defaultPassword']
 
 #Delete if Existing
 REMOVE Employee; UID[unique=true];
 ;demo-myemployee;
 
 #Insert new records
 
 INSERT_UPDATE Employee;UID[unique=true];$setPassword;description;name;groups(uid);sessionLanguage(isocode);sessionCurrency(isocode)
 ;demo-myemployeee;;A Demo Employee of XYZ;XYZ Employee;;en;;
 
 #End Create Employees

This employee is then granted a User Group that gives them global read-only permissions. The issue is I cannot log into the HMC with the username 'demo-myemployee' and password '1234' The username / password is apparently mismatched. If I reset the password with the admin user, I can successfully log in.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks everyone. It would appear my typo was the issue >.<

Former Member
0 Kudos

Hi Colin!

Firstly, I agree with Setu (voted up!) that if your user is to login to the hMC, he/she needs to belong to the employeegroup (or admingroup!) user group so please add the group in the data row, instead of leaving it blank as you have in your post. Otherwise, you will get an error:

You are not allowed to login into the Management Console!


However, in your script, there seems to be a typo as you have demo-myemployee for the UID of the item you're trying to remove if it exists but you have demo-myemployeee (extra 'e'!) when you're recreating the employee. If you try to login as the first one, it will not work as the employee has been removed or might not have the same details as the one you recently created with the extra 'e'.

Please have a look at this, in case it wasn't just a typo in the post.

With the revised ImpEx script, I am able to create and login with the required user into hMC, which means the import of the employee's password was successful on my side and that shouldn't be the issue.

Check the above and let us know if your issue still persists.

Best regards,

Niko

Former Member
0 Kudos

Hi Colin,

I noticed that you are not setting any group on the employee. can you try setting the employeegroup as follows:

 INSERT_UPDATE Employee;UID[unique=true];$setPassword;description;name;groups(uid)[mode=append];sessionLanguage(isocode);sessionCurrency(isocode)
  ;demo-myemployeee;;A Demo Employee of XYZ;XYZ Employee; employeegroup;en;;

You can then try adding more groups to the user. Notice the [mode=append] header attribute for the groups column. You should be able to specify a list of groups using comma separated values. For example:

 INSERT_UPDATE Employee;UID[unique=true];$setPassword;description;name;groups(uid)[mode=append];sessionLanguage(isocode);sessionCurrency(isocode)
  ;demo-myemployeee;;A Demo Employee of XYZ;XYZ Employee; employeegroup,acctmgrgroup,cockpitgroup;en;;