cancel
Showing results for 
Search instead for 
Did you mean: 

​How do we change default passwords for hac_viewer and hac_editor ?

0 Kudos

How do we change default passwords for hac_viewer and hac_editor ? What is the impact to change default password in application?

Accepted Solutions (0)

Answers (4)

Answers (4)

gaurav11
Participant

Hi,

Have you tried the below impex?

UPDATE User;UID[unique=true];password[default=pw4all];loginDisabled[default=false]

;hac_viewer

;hac_editor

0 Kudos

Thank you all, below impex is working as expected were we can able to update password encoding as required and also we can handle the belwo exception

UPDATE Employee;UID[unique=true];passwordEncoding[default=plain]
,,,,Exception : line 2: cannot update 8801368834052 with values ItemAttributeMap[ registry: null, type: <null>, data: {passwordencoding=plain} ] due to [de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator@62e05c15]:missing values for [passwordEncoding] in model UserPasswordChangeAuditModel (<unsaved>) to create a new UserPasswordChangeAudit, Exception : line 3: cannot update 8801368834052 with values ItemAttributeMap[ registry: null, type: <null>, data: {passwordencoding=plain} ]

Impex:

UPDATE Employee[impex.legacy.mode=true];UID[unique=true];passwordEncoding[default=plain];

;hac_editor;plain

;hac_viewer;plain
0 Kudos

Yes Gaurav, I'm able to update password but i do want to use password encoding(Plain) for these 2 employees.

Regards,

Bhaskar

adambadura
Participant
0 Kudos

In the current version (2211) hac_viewer and hac_editor have no default password set at all (official docs).

I assume that you are looking for a way on how to configure the system to set the password for this user during init/update? If yes then for test environments you can put it in an impex file that will be loaded during project data import phase. But you need to be careful to not leave the default password set on production environment (or any environment containing production data copy).

Here is some more info: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/ddc1ef9fc7fa48cb90f2b57c061a4012/c5d463ec2...

0 Kudos

Thank you very much! Adam.

How do we change pwd in production environment for those two hac_editor and hac_viewer?

romitchhabra
Participant
0 Kudos

Hi Bhaskara,

Login to backoffice as admin, find those users and change password.

adambadura
Participant
0 Kudos

bhaskarareddy.muga Or you can use Impex as well as described here. It would go something like this:

UPDATE User;UID[unique=true];password;loginDisabled[default=false]
	"#%beforeEach:
	import org.slf4j.Logger;
	import org.slf4j.LoggerFactory;
	import de.hybris.platform.servicelayer.user.UserService;
	import de.hybris.platform.servicelayer.exceptions.UnknownIdentifierException;
	ERROR_MESSAGE_TEMPLATE = ""Password for the user [{}] can not be set because the user does not exist"";
	Logger LOG = LoggerFactory.getLogger(""ImpExImportReader"");
	UserService userService = Registry.getApplicationContext().getBean(""userService"", UserService.class);
	userUid = line.get(1);
	try
	{
		userService.getUserForUID(userUid);
	}
	catch (UnknownIdentifierException ex)
	{
		LOG.info(ERROR_MESSAGE_TEMPLATE, userUid);
		line.clear();
	}"
; hac_editor; <Password for hac_editor> ; hac_viewer; <Password for hac_viewer>

Just remember to keep the production passwords secure i.e. keep them in a location that only authorize personnel can access (instead of for example code repository accessible to the whole project team).

0 Kudos

Hi Adam,

Thank you very much! for your response.

How do we set password encoding as plain for hac_viewer and hac_editor employees.Is this impex correct?

Sample impex:

$passwordEncoding=plain

INSERT_UPDATE Employee;UID[unique=true];$passwordEncoding[default='$passwordEncoding']

;hac_editor;

;hac_viewer;

Thanks,

Bhaskar

adambadura
Participant
0 Kudos

It goes like this:

INSERT_UPDATE Employee;UID[unique=true];password;passwordEncoding[default=plain]
;hac_editor
;hac_viewer

However, using plain password encoding is not recommended, better use the default (which is pdkdf2).