Expand my Community achievements bar.

SOLVED

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

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

14 Replies

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 2
Thank you wodnicki. But these JSSPs are not bound by any authentication right? Is not that a security concern?

Avatar

Administrator
@ wodnicki Can you please clarify @kkedem 's concern? Thanks!


Sukrity Wadhwa

Avatar

Community Advisor
i can answer.. you can make them and you can make them not be bound by authentication. If you generate any code from web app you will see this line is handling authentication if( !jsspContext.checkAuthentication(response) ) return

Avatar

Level 2

Actually i like this idea and tried to implement it. However, when tried to execute a localhost call, ACC complained about localhost not present in allowed list of URLs. I tried to add localhost through the control panel but the regex prevented me. I tried to whitelist the server name ending with .adobe.com but the control center prevented me saying in order to avoid loops whitelisting own server url url is restricted. any ideas on how to trigger the localhost call then?

 

@Jonathon_wodnicki - any ideas on this? Is there a special way to get around this URL permissions thing and execute a localhost call?

 

@Amit_Kumar  - hey, can you help on this one? i am unable to get the localhost call to work from JS. Are there ways to workaround it?

Avatar

Level 6

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)

Avatar

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

Avatar

Level 2
I tried this but unfortunately the decryptString return empty string. And I think I am in the same build as you 9032@3a9dc9c

Avatar

Administrator
Hey @Florian_Courgey, Can you direct me to that doc? I would be happy to get that rectified. Thanks!


Sukrity Wadhwa

Avatar

Administrator
Thanks Florian! I have escalated this to the Product Documentation team..


Sukrity Wadhwa

Avatar

Administrator

Hi,

This function has been deprecated in 2018. 

Refer to the release notes of release 18.6 here: https://docs.adobe.com/content/help/en/campaign-classic/using/release-notes/previous-releases/releas...

And, the Deprecated and removed features section here: https://docs.adobe.com/content/help/en/campaign-classic/using/release-notes/deprecated-compatibility...

It should no longer be available in the product.

Thanks!



Sukrity Wadhwa