PHP Server Side Post to Recreate Replacing Secure Single Sign-On

I host and intranet and manage several separate entries for external websites. We always did this through some hidden form.

Example

<form method="post" action="example.php">
<input type="hidden" value="user" name="user" />  
<input type="hidden" value="password" name="password" />
</form>

Then we can pass the javascript event in a hidden form behind the scenes and log in.

However, a more experienced user who has already authenticated on our site can view the source code and view the username and password.

I would prefer that the information posted in a PHP script be easily recorded on an external site.

I did a lot of research on the Internet and developed several consecutive lines of code that people implement that don't seem to work.

They usually look like the code below:

 $ch = curl_init($POSTURL);
 curl_setopt($ch, CURLOPT_POST      ,1);
 curl_setopt($ch, CURLOPT_POSTFIELDS,POSTVARS);
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION  ,1);
 curl_setopt($ch, CURLOPT_HEADER      ,0);  // DO NOT RETURN HTTP HEADERS
 curl_setopt($ch, CURLOPT_RETURNTRANSFER  ,1);  // RETURN THE CONTENTS OF THE CALL
 $Rec_Data = curl_exec($ch);
 curl_close($ch);

, . , curl_exec, . , .

:

: : CAfile:/etc/ssl/certs  /ca -certificates.crt CApath: none

, , . HTML, , . ?

, - Coldfusion. . , PHP -!

+3
1

cURL .

, , , . -, . cookie , (, , ).

, ? ? .

, -. , .

HTML JavaScript onSubmit, ( , ).

(, ) Flash Java ActiveX -. , , ( , ), .

+1

Source: https://habr.com/ru/post/1737540/


All Articles