cancel
Showing results for 
Search instead for 
Did you mean: 

Plain text is displayed in backoffice instead of encrypted value after encrypted="true"

I have to encrypt a field value which is of type String. Below is the declaration:

 <attribute qualifier="value" type="java.lang.String">
   <persistence type="property">
         <columntype>
             <value>HYBRIS.LONG_STRING</value>
         </columntype>
     </persistence>
   <modifiers encrypted="true"/>
 </attribute>

When I see this field in Backoffice, it displays as plain text but if I search this using the flexible search then I see the encrypted value. I want this encrypted value to be displayed in Backoffice but not the plain text. I see that in OOTB for some attributes with encrypted="true" , the encrypted value is displayed in Backoffice. Am I missing anything? Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member620692
Active Contributor
0 Kudos

The FS Query returns exactly the same data which is stored in the database and therefore you see the encrypted value with FS Query. AFAIK, backoffice does not display the data of an encrypted field in the encrypted form e.g. the Password Question field of a user (customer or employee) always displays the decrypted value in backoffice although it is marked as encrypted=true in items.xml.

I can't think of any use case to display the encrypted data in backoffice. It is like displaying ******** for a password field. What will a backoffice user do with an encrypted value? Instead of displaying an encrypted value, it's better not to display it at all.

Note: the 'Migrate' functionality at https://localhost:9002/maintain/keys has nothing to do with the display. It is used to migrate the old unencrypted values to encrypted values. Once an attribute has been built with encrypted=true, all new/updated values will automatically be saved in encrypted form in the database.

Answers (1)

Answers (1)

geffchang
Active Contributor
0 Kudos

Did value attribute already exist before you added the encrypted modifier?

Any existing data is not encrypted. You can trigger the encryption by clicking the Migrate button here: https://localhost:9002/maintain/keys After that, the data should be encrypted.

0 Kudos

No it was not existing before. I declared it along with encrypted modifier. I tried the migrate button but still it is not working.