Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

How to send user id and password to SAP portal and get the status back

Avatar

Level 1
Level 1

On the click of a button in my (SAP) Adobe Interactive Form,

I need to verify the log in user id and password to SAP portal and get the status or something back.

So I chose the following approach with javascript

at button CLICK event in the adobe form 

var cPortalUrl = "https://xyz.abcd.com:50001/irj/portal?j_user=<userid>&j_password=<password>";

var cStatus;

var pingportalstatus =
function PortalPing (cPortalUrl){
    var xmlHttp = new XMLHttpRequest();

xmlHttp.onreadystatechange = function()  

     { 

          cStatus =  xmlHttp.status;

     };


    xmlHttp.open("GET", cPortalUrl, false);
    xmlHttp.send();

return xmlHttp.status;
};

But I am not getting any status back in cStatus.

Please advise

Thanks,

Bhaskar

3 Replies

Avatar

Level 10

You can try the FormCalc Get() method to receive data from a server.

$host.messageBox(Get("https://xyz.abcd.com:50001/irj/portal?j_user=<userid>&j_password=<password>"))

Avatar

Level 1
Level 1

I already am using JavaScript for button click

So I can use xfa.host.messagebox

but the thing is:

When the user clicks on the button a pop-up comes up for him to input User Id and password.

This user id and password will be concatenated into the URL mentioned above in the initial post.

So the URL needs to be triggered in a background and return message needs to be captured.

Please advise.

Avatar

Level 10

The JavaScript engine of Acrobat doesn't support theXMLHttpRequest() constructor I'm afraid, so you should try the FormCalc method.