How to modify Glideencrypter API methods ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 09:38 PM
Hai I am using the run script for reset AD password through workflow but in script we are used the GlideEncrypter but servicenow The GlideEncrypter API is planned for deprecation so how to modify that script
script:
//Generate Random Password and Set AD password.
var encr= new GlideEncrypter();
var clearString = new PwdCryptoSecureAutoGenPassword().generatePassword();
var encrString = encr.encrypt(clearString); //Encrypted password for use in the Set AD Password Activity.
workflow.scratchpad.pass = encrString; //Set scratchpad password variable to the encrypted password string.
var decrString = workflow.scratchpad.clearpass = encr.decrypt(encrString); //Can be used as the clear text password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 03:57 PM
@SIVASANKARA Did you find any solutions that work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2024 09:07 PM
Hi @Jeenet1 No
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2025 02:08 AM - edited 02-05-2025 04:40 AM
Hi @SIVASANKARA ,
We tried using OOTB script include (PasswordResetUtil) and it seems working.
Our old code:
var encr = new GlideEncrypter();
var clearString = new ADPwdCryptoSecureAutoGenPassword().generatePassword()+"1D";
var encrString = encr.encrypt(clearString);
workflow.scratchpad.password = encrString;
var decrString = workflow.scratchpad.clearpass = encr.decrypt(encrString);
Updated code:
var encr = new PasswordResetUtil();
var clearString = new ADPwdCryptoSecureAutoGenPassword().generatePassword()+"1D";
var encrString = encr .encryptWithKMFModule(clearString);
workflow.scratchpad.password = encrString;
var decrString = workflow.scratchpad.clearpass =encr.decryptWithKMFModule(encrString);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2025 03:32 AM
Hi @Jeenet1 Thank u for update We also using Same OOB function