Decrypting user password in business rule or script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2014 09:32 AM
Hi All,
There is need to decrypt user password and need to send it from ServiceNow to ITIM (IBM Tivoli identity manager) in string format.
I am trying to decrypt password with below code but it is not working as expected.
var Encrypter = new GlideEncrypter();
//var Encrypter = new Packages.com.glide.util.Encrypter();
var psw = Encrypter.decrypt(current.u_password);
I don't see decrypt function is working properly. Code is returning encrypted password only.
Any idea what's wrong here.
Thanks,
-Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2014 09:25 PM
Hi All,
I changed data type for "u_password" field, from password to password2, and it is working fine now.
var Encrypter = new GlideEncrypter();
var encrypted = current.u_password; // current.<<your field name>>
var decrypted = Encrypter.decrypt(encrypted);
gs.addInfoMessage("encrypted.. " + encrypted);
gs.addInfoMessage("decrypted.. " + decrypted);
Thanks,
-Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2016 04:26 AM
Hi,
I need decrypt password in .NET application.
means I get the user records from servicenow to my .net application via API/WSDL Web Service.
password (2 way encryption) field available in User Table.
Whenever I will fetch record via API/WSDL Web Service then I get encrypted password But actually I want decrypted password via API/WSDL Web Service.
Any helpful topic for this.
Please reply ASAP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2016 12:00 PM
Thanks, Anand!
This worked perfectly for a solution I'd been researching.
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2018 04:17 AM
I am trying above solution but facing below error message, what exactly the mistake am i doing?
"Invalid object in scoped script: [JavaClass com.glide.util.Encrypter]"
var Encrypter = new global.GlideEncrypter();
var decrypted = Encrypter.decrypt(target.password2);
gs.info("decrypted Password2 : " + decrypted);