The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to decrypt password2 value using GlideEncrypter() in scoped application.

mansing
Giga Contributor

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?

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards
Ankur

mansing
Giga Contributor

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?

Please use below to decrypt password for scoped app.

 

gr.<element>.getDecryptedValue()

 

Regards,

Sachin

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.