title: facebook api over rest getting Incorrect signature <error_code> 104
body: <p>im trying to send rest api Users.getLoggedInUser
  i have all the secret session and all the Authenticationi made 
  according to this site : 
  <a href="http://wiki.developers.facebook.com/index.php/Authorization_and_Authentication_for_Desktop_Applications" rel="nofollow noreferrer">http://wiki.developers.facebook.com/index.php/Authorization_and_Authentication_for_Desktop_Applications</a>
  here is my code (cpp QT but it can be any thing else ) :</p>
  
  <pre><code>QString toAPISignature = 
                  "api_key="
                  +  API_KEY 
                  + "call_id=" + strCallid 
                  + "format=XML" 
                  + "method=Users.getLoggedInUser"
                  + "session_key="+ fbSessionKey  
                  + "v=1.0"+m_fbSecretKey;
  
  QByteArray hashedApiData= QCryptographicHash::hash(toAPISignature.toAscii(),
            QCryptographicHash::Md5);
  QString APIMD5Signature(hashedApiData);
  
  
  .....
  .....
  .....
  // now set the api request
   QUrl api_url;
   api_url.setUrl(FB_REST_URL);
   api_url.addQueryItem("api_key",API_KEY);
   api_url.addQueryItem("session_key",fbSessionKey);
   api_url.addQueryItem("call_id",strCallid);
   api_url.addQueryItem("sig",APIMD5Signature);
   api_url.addQueryItem("format","XML");
   api_url.addQueryItem("method","Users.getLoggedInUser");
   api_url.addQueryItem("v","1.0");
  
  then i init the request object :
  
  QNetworkRequest request;
  request.setHeader(QNetworkRequest::ContentTypeHeader,"application/x-www-form-urlencoded");
  request.setRawHeader("User-Agent", "Facebook API Client 0.1");
  request.setUrl(url);
  
  do the get request :
  QEventLoop loop;
  QNetworkReply *reply = networkManager-&gt;get(request);
  connect(reply, SIGNAL(finished()), &amp;loop, SLOT(quit()));
  loop.exec();
  QByteArray data=reply-&gt;readAll();
  </code></pre>
  
  <p>and this is the xml im getting back:
  look ..why the sig looks like this ? 
  does the hash MD5 suppose to look like set of numbers ?</p>
  
  <pre><code>&lt;arg&gt;
        &lt;key&gt;sig&lt;/key&gt;
        &lt;value&gt;N{?¬???¬@?±B???????¶&lt;/value&gt;
   &lt;/arg&gt;
  
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;error_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd"&gt;
    &lt;error_code&gt;104&lt;/error_code&gt;
    &lt;error_msg&gt;Incorrect signature&lt;/error_msg&gt;
    &lt;request_args list="true"&gt;
      &lt;arg&gt;
        &lt;key&gt;api_key&lt;/key&gt;
        &lt;value&gt;bc5xxxxxxxxx57811&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;session_key&lt;/key&gt;
        &lt;value&gt;a99fdxxxxxxx5c2-100xxxxx455&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;call_id&lt;/key&gt;
        &lt;value&gt;1&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;sig&lt;/key&gt;
        &lt;value&gt;N{?¬???¬@?±B???????¶&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;format&lt;/key&gt;
        &lt;value&gt;XML&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;method&lt;/key&gt;
        &lt;value&gt;Users.getLoggedInUser&lt;/value&gt;
      &lt;/arg&gt;
      &lt;arg&gt;
        &lt;key&gt;v&lt;/key&gt;
        &lt;value&gt;1.0&lt;/value&gt;
      &lt;/arg&gt;
    &lt;/request_args&gt;
  &lt;/error_response&gt;
  </code></pre>