title: How i can authentication on steam site?
body: <p>I try to login on steam using the following code. </p>
  
  <p><code>steamcommunity.com/login/getrsakey</code> first request is successful.</p>
  
  <p>Request a <code>steamcommunity.com/login/dologin/</code> all the time gives an error <code>incorrect login.</code> </p>
  
  <p>Perhaps dealing with encryption password or need to add ssl. </p>
  
  <p>I use to encrypt library on <code>http://phpseclib.sourceforge.net/</code></p>
  
  <pre><code>function geturl($url, $ref, $cookie, $postdata, $header, &amp;$info, &amp;$output)
      {
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, $url);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
          curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
          curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
          curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36');
          if ($ref)
          {
              curl_setopt($ch, CURLOPT_REFERER, $ref);
          }
          if ($cookie)
          {
              curl_setopt($ch, CURLOPT_COOKIE, $cookie);
          }
  
          if ($postdata)
          {
              curl_setopt($ch, CURLOPT_POST, true);
              $postStr = "";
              foreach ($postdata as $key =&gt; $value)
              {
                  if ($postStr)
                      $postStr .= "&amp;";
                  $postStr .= $key . "=" . $value;
              }
              curl_setopt($ch, CURLOPT_POSTFIELDS, $postStr);
          }
  
          curl_setopt($ch, CURLOPT_HEADER, $header);
          $info = curl_getinfo($ch);
          $output = curl_exec($ch);
          curl_close($ch);
      }
  geturl("https://steamcommunity.com/login/getrsakey", null, null, array('username' =&gt; $login), 0, $info, $output);
  $data = json_decode($output, true);
  
  if ($data['success'] === true)
  {
      $publickey_exp = $data['publickey_exp'];
      $publickey_mod = $data['publickey_mod'];
      $RSA = new Crypt_RSA();
      $RSA-&gt;setEncryptionMode(CRYPT_RSA_ENCRYPTION_PKCS1);
      $n = new Math_BigInteger($publickey_mod, 16);
      $e = new Math_BigInteger($publickey_exp, 16);
  
      $key = array("modulus"=&gt;$n, "publicExponent"=&gt;$e);
      $RSA-&gt;loadKey($key, CRYPT_RSA_PUBLIC_FORMAT_RAW);
      $encryptedPassword = base64_encode($RSA-&gt;encrypt($password, false));
      $captchaGid = -1;
      $captchaText;
      $emailAuth;
      $emailSteamId;
  
          $params = array(
              'username' =&gt; $login,
              'password' =&gt; $encryptedPassword,
              'rsatimestamp' =&gt; $data['timestamp'],
              'captcha_gid' =&gt; $captchaGid,
              'captcha_text' =&gt; $captchaText,
              'emailauth' =&gt; $emailAuth,
              'emailsteamid' =&gt; $emailSteamId
          );
          geturl("https://steamcommunity.com/login/dologin/", null, null, $params, 0, $info, $output);
          $data = json_decode($output, true);
          var_dump($data);
          if ($data['captcha_needed'])
          {
              $captchaGid = $data['captcha_gid'];
              echo '&lt;img src="https://steamcommunity.com/public/captcha.php?gid=' . $captchaGid . '"&gt;';
          }
  }
  </code></pre>