title: How to authenticate a post request in php
body: <p>I am trying to implement the HTTP Post Authentication, Which mentioned on this document <a href="https://www.clearslide.com/view/mail?iID=YS7LCS8XDPCABFR453DE" rel="nofollow">https://www.clearslide.com/view/mail?iID=YS7LCS8XDPCABFR453DE</a> , I am not able to understand what exactly i have to do to get this working, I tried to dump <em>$_REQUEST</em> and <em>$_SERVER</em> variables.</p>
  
  <p>This is the output i am getting for this $_REQUEST</p>
  
  <pre><code>Array
  (
      [emailpitchsent] =&gt;
  )
  </code></pre>
  
  <p>And this the output for $_SERVER</p>
  
  <pre><code>Array
  (
      [HTTP_HMAC] =&gt; D4L1ICmRMii32PdCryBkpSNdxY5XDxC_OXsDTEucyzU
      [HTTP_DATE] =&gt; Thu, 12 Nov 2015 00:50:05 PST
      [HTTP_SHA1] =&gt; GTRFkX7JYVtDQgvrQeXJmHaCF24=
      [CONTENT_LENGTH] =&gt; 262
      [CONTENT_TYPE] =&gt; application/json; charset=UTF-8
      [HTTP_HOST] =&gt; myhost.com
      [HTTP_CONNECTION] =&gt; Keep-Alive
      [HTTP_USER_AGENT] =&gt; Apache-HttpClient/4.5.1 (Java/1.7.0_55)
      [PATH] =&gt; /sbin:/usr/sbin:/bin:/usr/bin
      [SERVER_SIGNATURE] =&gt; &lt;address&gt;Apache/2.2.31 (Amazon) Server at myhost.com Port 80&lt;/address&gt;
  
      [SERVER_SOFTWARE] =&gt; Apache/2.2.31 (Amazon)
      [SERVER_NAME] =&gt; myhost.com
      [SERVER_ADDR] =&gt; 0.0.0.0
      [SERVER_PORT] =&gt; 80
      [REMOTE_ADDR] =&gt; 0.0.0.1
      [DOCUMENT_ROOT] =&gt; /var/www/vhosts/myhost.com/httpdocs
      [SERVER_ADMIN] =&gt; info@myhost.com
      [SCRIPT_FILENAME] =&gt; /var/www/vhosts/myhost.com/httpdocs/clearslide.php
      [REMOTE_PORT] =&gt; 47400
      [GATEWAY_INTERFACE] =&gt; CGI/1.1
      [SERVER_PROTOCOL] =&gt; HTTP/1.1
      [REQUEST_METHOD] =&gt; POST
      [QUERY_STRING] =&gt; emailpitchsent
      [REQUEST_URI] =&gt; /clearslide.php?emailpitchsent
      [SCRIPT_NAME] =&gt; /clearslide.php
      [PHP_SELF] =&gt; /clearslide.php
      [REQUEST_TIME] =&gt; 1447318205
  )
  </code></pre>
  
  <p>This i the content of clearslide.php</p>
  
  <pre><code>&lt;?php
  $req_dump = print_r($_REQUEST, TRUE);
  $ser_dump = print_r($_SERVER,TRUE);
  $fp = fopen('request.log', 'a');
  fwrite($fp, $req_dump);
  fwrite($fp, $ser_dump);
  fclose($fp);
  </code></pre>
  
  <p>What i have to do now to get this thing working, How can i authenticate that request and get the data?.</p>
  
  <p>Thanks</p>