GlideEncrypter Deprecation - Password Reset Workflow

rachelconstanti
Mega Sage

Good morning,

 

GlideEncrypter Deprecation - KB1320986.

 

We have the below code in one of our workflows

 

 

// The Reset AD activity does not validate for password history requirements.
		// As a workaround, a combination of Reset AD and Change AD activities are used.
		// The password is first reset to a temporary system generated one, followed by change password.
		if(!workflow.inputs.u_password_needs_reset && workflow.scratchpad.enforce_history_policy) {
			var autoGenScript = credStore.getAutoGenPasswordScript();
			var params = {credentialStoreId : credStore.getId()};
			var tempPassword = new global[autoGenScript]().process(params);
			workflow.scratchpad.tempPassword = new GlideEncrypter().encrypt(tempPassword);
			workflow.scratchpad.tempPasswordNeedsChange = true;

 

 
With the deprecation of GlideEncrypter coming in the Zurich release I need to replace this line of code:

workflow.scratchpad.tempPassword = new GlideEncrypter().encrypt(tempPassword);
 
What can I use in its place?
Any help is appreciated.
Thank you,
Rachel
3 REPLIES 3

Kieran Anson
Kilo Patron

The KB recommends 

var encryptValueForMid = new GlideAutomationEncrypter().encrypt(decryptedValue); 

Thank you!

The alternatives in the KB were confusing to me.
I will give this a try...

Did you find any solutions that work? @rachelconstanti