GlideEncrypter API deprecation - help replacing a piece of code HowTo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2024 08:42 AM
Hello All,
We have the following code running within a Flow.
/*GET PASSOWRD*/
var pwvalue = new GlideappMaskedQuestion().decode(new GlideEncrypter().decrypt(fd_data._1__get_catalog_variables.password));
var encodedpw = new GlideappMaskedQuestion().decode(new GlideEncrypter("MY_ENCRYPTION_KEY").encrypt(pwvalue));
It recently started failing, so I logged a ticket with ServiceNow. They explained that the GlideEncrypter API is deprecated and shared this KB with me.
I managed to replace the first part of the code where I decrypt the value.
/*GET PASSOWRD*/
var pwvalue = new GlideappMaskedQuestion().decode(gr.password2field.getDecryptedValue(fd_data._1__get_catalog_variables.password));
I can't understand how to replace the part where I encrypt it again using "MY_ENCRYPTION_KEY".
Any idea?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2024 02:16 AM
Hi @AEterni ,
Yes GlideEncrypter API is no more supported.
you will need to use this as a replacement :
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1320986
I hope this helps...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....