Retrieve Password2 Field real value

Gpope
Tera Contributor

Hi Community! 

 

Anybody can help me with this issue I'm facing? 

 

I have a password2 field on core_company table. I need to get the real value that is on the field, how can I achieve this? 

 

I tried already with glideEncrypter but it's showing me only values like: 

 

Gpope_0-1713982380439.png

 

Thanks! 

9 REPLIES 9

Hi @Gpope,

 

Can you update the script as below and I highly recommend running it in the background script first.

var companyGr = new GlideRecord('core_company');
companyGr. get(current.getValue('u_supplier_name_ref'));

var encrypter = new global.GlideEncrypter();

g_scratchpad.vatCode = encrypter.decrypt(companyGr.getValue('u_vat_code'));

Can you confirm that u_supplier_name_ref contains the sys_id of a Company record?

 

DYCM
Mega Sage

Hi @Gpope ,

According to your screenshot, when you see this, please search for: global.com_glide_system_update_set_glideencrypter in the Log table (syslog) to see if you can find a similar log as shown below:
 

1.png

 
If you can find it, please try the steps below to to fix this issue:
 
Please log into ServiceNow with admin account.
1. Assign Admin with the "Key Management" admin role
DYCM_5-1714008544745.png

 

2. Go to "Module Access Policies" (if you can't see it in Navigator, go to sys_kmf_crypto_caller_policy table directly), search on "Crypto module" field with key word "com_glide_system_update_set_glideencrypter"

3.png

 

3. Set the Result to "Track"
4.png

 

4. If you can't find above record, create one, and set Result to "Track"

 

 
 
 
 
 
 
 
 

Haven't seen this before, thanks for sharing!

Just to add to DYCM's comment, you will need to log out and log back in after Step 1 so that the role is applied.

And it looks like the value of the 'Crypto module' can vary depending on where you are invoking the function.

When I ran the script in the background script, the error log mentioned global.com_snc_core_automation_glideencrypter instead. So make sure you use the right value that is mentioned in the error log.

@James Chun , good point, I forgot to mention, thanks for bringing this up - the value of the 'Crypto module' can vary 😉

 

Gpope
Tera Contributor

Hi @DYCM  ! 

Thanks for your response in here, but unfortunatelly I'm not seeing anything even searching by *encrypter on the logs.