on 06-02-2023 4:47 PM
How do we change default passwords for hac_viewer and hac_editor ? What is the impact to change default password in application?
Hi,
Have you tried the below impex?
UPDATE User;UID[unique=true];password[default=pw4all];loginDisabled[default=false]
;hac_viewer
;hac_editor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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]Impex:
UPDATE Employee[impex.legacy.mode=true];UID[unique=true];passwordEncoding[default=plain];
;hac_editor;plain
;hac_viewer;plainYou must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes Gaurav, I'm able to update password but i do want to use password encoding(Plain) for these 2 employees.
Regards,
Bhaskar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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).
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
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.