How to make a localhost JSSP call from JS code? | Community
Skip to main content
Level 2
October 5, 2020
Solved

How to make a localhost JSSP call from JS code?

  • October 5, 2020
  • 1 reply
  • 2336 views

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

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,

 

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

 

1 reply

Jonathon_wodnicki
Community Advisor
Jonathon_wodnickiCommunity AdvisorAccepted solution
Community Advisor
October 7, 2020

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

 

kkedemAuthor
Level 2
October 20, 2020
Many thanks Jon. I gave it a try today and it works!