php - Failed to validate oauth signature and token - Issue generating OAuth Token -


Text after "

I have been looking at creating a sign on the OAuth site & Over SF, but still I make my signature I always get the same error, any idea what I'm doing wrong here

  error :? OAuth sign and token  failed to validate  

I have a working app for the old rest API, so I know that my issue to my application or server etc

  is not lt? Php function Post_Data ($ url, $ data, $ header) {$ ch = curl_init (); Curl_setopt ($ ch, CURLOPT_URL, $ url); Curl_setopt ($ CH, CURLOPT_POST, 1); Curl_setopt ($ CH, CURLOPT_POSTFIELDS, $ data); Curl_setopt ($ CH, CURLOPT_HTTPHEADER, $ header); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); $ Result = curl_xac ($ CH); Curl_close ($ ch); Return result; } // OAuth Token $ consumer_key = "get hidden"; $ Consumer_secret = "hidden"; $ Request_url = "http://api.twitter.com/oauth/request_token"; $ Callback = "http: //". $ _ Server ['HTTP_HOST']. $ _ Server ['PHP_SELF']; $ Non = MD5 (time); $ Timestamp = time (); $ Data = array ("oauth_callback" = & gt; $ callback, "oauth_consumer_key" = & gt; $ consumer_key, "oauth_nonce" = & gt; $ temporarily, "oauth_signature_method" => "HMAC-SHA1" "Oauth_timestamp" = & gt; $ timestamp, "oth_version" => 1.0 "); $ Post_string = ''; Forex currency ($ data as $ key = & gt; $ value) {$ post_string = $ key '='. ($ Value). '& Amp;'; } $ Post_string = rtrim ($ post_string, '& amp;'); $ Base_string = 'get & amp;' Urlencode ($ request_url) .. '& Amp;' Urlencode ($ post_string). $ Data ["oauth_signature"] = base64_encode (hash_hmac ('SHA1', $ base_string, $ consumer_secret, true)); $ Header = array ("expected:"); $ Content = Post_Data ($ request_url, $ data, $ header); Print_r ($ content); ? & Gt;    

Is it possible to watch your server?

Comments