Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Validate 1
Level 1
kkedem
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
kkedem
Level 1

Likes

0 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
kkedem
Level 1

18-09-2020

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
wodnicki
MVP

Likes

938 likes

Total Posts

1,061 posts

Correct Reply

495 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile

Avatar
Contributor
MVP
wodnicki
MVP

Likes

938 likes

Total Posts

1,061 posts

Correct Reply

495 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile
wodnicki
MVP

20-09-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

Answers (1)

Answers (1)

Avatar

Avatar
Springboard
MVP
Florian_Courgey
MVP

Likes

93 likes

Total Posts

87 posts

Correct Reply

19 solutions
Top badges earned
Springboard
Validate 1
Establish
Contributor
Ignite 1
View profile

Avatar
Springboard
MVP
Florian_Courgey
MVP

Likes

93 likes

Total Posts

87 posts

Correct Reply

19 solutions
Top badges earned
Springboard
Validate 1
Establish
Contributor
Ignite 1
View profile
Florian_Courgey
MVP

21-09-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)