Expand my Community achievements bar.

SOLVED

How to make a localhost JSSP call from JS code?

Avatar

Level 2

Hi,
I have been trying to make a call to a JSSP from the JS code for decrypting a string.  The URL looks like this: http://localhost:8080/test/decrypt.jssp
When executed this code, as expected JS code complained about localhost not being present in the allowed list of domains for making external call. When I tried to add localhost using control panel. control panel regex blocked me from adding local host to whitelist.

I tried to add the server external facing URL (ending with .adobe.com) but control panel again blocked me from adding saying inorder to avoid loops, whitelisting own server url is restricted?

So how do I make a localhost call to JSSP from JS?

Regards,

Kiran

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

 

You can add it to the whitelist per this doc:

 

NB the HTTPClientRequest class has a lot of bugs in its implementation, one of which is somehow failing to consistently check urlPermission.

Not advising it, but the security is trivially sidestepped by setting the URL to 'marketing.adobe.com' in the constructor call, then changing to anything afterward:

var hcr = new HttpClientRequest('https://marketing.adobe.com');
hcr.url = 'http://localhost/...';

 

Thanks,

-Jon

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi,

 

You can add it to the whitelist per this doc:

 

NB the HTTPClientRequest class has a lot of bugs in its implementation, one of which is somehow failing to consistently check urlPermission.

Not advising it, but the security is trivially sidestepped by setting the URL to 'marketing.adobe.com' in the constructor call, then changing to anything afterward:

var hcr = new HttpClientRequest('https://marketing.adobe.com');
hcr.url = 'http://localhost/...';

 

Thanks,

-Jon

 

Avatar

Level 2
Many thanks Jon. I gave it a try today and it works!