How to get password from external account in workflow JS code? | Community
Skip to main content
Level 2
September 18, 2020
Solved

How to get password from external account in workflow JS code?

  • September 18, 2020
  • 2 replies
  • 4619 views

Hi,


I am trying to connect to a third party service and download files as part of a technical workflow. However, when I tried to use the password from external account, I ended up learning that decryptPassword() can only be used in JSSP and SOAP calls.

How can I avoid hardcoding passwords in the workflow? And at the same time I dont want to configure a plain text password any where in the system?

Regards,

Kiran

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jonathon_wodnicki

Hi,

 

The function works fine from JSSP, i.e. <%= decryptPassword(request.getParameter('s')) %>.

From there it's an HTTPClientRequest() call to localhost to pick it up.

 

Thanks,

-Jon

2 replies

Jonathon_wodnicki
Community Advisor
Jonathon_wodnickiCommunity AdvisorAccepted solution
Community Advisor
September 21, 2020

Hi,

 

The function works fine from JSSP, i.e. <%= decryptPassword(request.getParameter('s')) %>.

From there it's an HTTPClientRequest() call to localhost to pick it up.

 

Thanks,

-Jon

kkedemAuthor
Level 2
September 29, 2020
Thank you wodnicki. But these JSSPs are not bound by any authentication right? Is not that a security concern?
Florian_Courgey
Level 4
September 21, 2020

Hi,

I tried and it worked well in a JS activity (in a workflow) with decryptPassword on build 9032:

 

 

 

var account = NLWS.nmsExtAccount.load(999999); var cryptedPassword = account.password; logInfo('cryptedPassword:', cryptedPassword); // "@Ohdznkl1fre1fs6e4rg68rezbk1==" //var password = decryptString(cryptedPassword); // use before build 8947 var password = decryptPassword(cryptedPassword); // use starting from build 8947 logInfo('password:', password); // "my_P@ssw0rd"

 

 

disclaimer: the decryptString function is deprecated since build 8947 (25 June 2018)

Marcel_Szimonisz
Community Advisor
Community Advisor
September 29, 2020
It could be mistake as there is no replacement listed.. i had a good laugh on it the other day