The CreatorCon Call for Content is officially open! Get started here.

How to decrypt the password2 (2 way encryption) field in flow designer action?

MugTm09
Giga Guru

Hello everyone.

 

I tried to pass the OAuth key in the REST STEP of the flow action, but when I checked the logs, it appears to be passed as *****. Does anyone know how to resolve this?

MugTm09_0-1760511732557.png

MugTm09_1-1760511857241.png

 

1 ACCEPTED SOLUTION

@MugTm09 

the access token will go as plain text and you need not worry about encryption or decryption of that.

yes the Flow REST Step works that way OOTB

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

MugTm09
Giga Guru

Please note that the following script cannot be used.
Error: GlideEncrypter is deprecated and now returns null,

please refer to KB1320986 for alternatives; Reason: TripleDES deprecation; Category: Security

objEncrypter = new GlideEncrypter();  
var strDecrypted = objEncrypter.decrypt(fd_data._1__get_connection_info_step.credential_value);  
return strDecrypted; 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@MugTm09 

Looks you are first getting the access token and then using that in Actual POST API call and including that in Authorization Header.

if yes then why to decrypt?

if you are doing the above the Token won't be encrypted as per my understanding when you check flow execution context

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks, @Ankur Bawiskar .
Based on the test execution results, it appears that the header is functioning as the string [*****], which led me to suspect that the API endpoint might not be returning the expected response because asterisks are actually being sent.
This made me feel the need to decrypt the value.
Originally, is the REST API action supposed to work without requiring decryption?

@MugTm09 

the access token will go as plain text and you need not worry about encryption or decryption of that.

yes the Flow REST Step works that way OOTB

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader