Unable to decrypt password2 value using GlideEncrypter() in scoped application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2019 02:49 AM
We are trying to decrypt password2 value and found out that below code fails in scoped app.
var Encrypter = new GlideEncrypter();
var decrypted_password = Encrypter.decrypt(inputs.password);
Further we tried with below one and no go.
var decrypt = pwd.getDecryptedvalue();
Any help here please?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2019 02:52 AM
Hi Mansing,
I think that won't work in scoped app.
Where is this code written i.e. which component?
You can write that component in global scope and check once.
Check below link once:
https://community.servicenow.com/community?id=community_question&sys_id=97bf8b65dbdcdbc01dcaf3231f961945
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2019 07:51 PM
I'm writing this script inside orchestration's activity and within scoped app. And I want to achieve decryption from within scoped app only.
Also I have checked the link you provided above and has GlideEncrypter() function used which is not allowed in scoped app.
Any other solution?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2019 08:31 PM
Please use below to decrypt password for scoped app.
gr.<element>.getDecryptedValue()
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2019 09:54 PM
Hi Sachin,
Sorry no go. I tried with below and it is throwing an error "Cannot find function getDecryptedvalue in object If4KGcvevot7MaSa+EyjG="
var gr = new GlideRecord('u_test_password');
gr.addQuery('u_name', 'Mansing');
gr.query();
while (gr.next()) {
gr.next();
var test = gr.u_password.getDecryptedvalue();
}
Note - The table u_test_password is in a global scope.