Encrypted password for "cuba.web.ldap.password"


is there a way to specify the password for the app setting “cuba.web.ldap.password” in encrypted form instead of plain text?


Hi Andreas,

CUBA does not provide any built-in features for working with encrypted properties. However, you can easily modify the property value on application start:

public void applicationContextInitialized(AppContextInitializedEvent event) {
    String encryptedProperty = AppContext.getProperty("cuba.web.ldap.password");
    AppContext.setProperty("cuba.web.ldap.password", decrypt(encryptedProperty));

Also, consider providing the property value as an OS environment variable (see the docs), maybe then you won’t need the encryption.