Another failed to validate oauth signature and token error


#1

when i send http post request using Marmalade sdk
i got [failed to validate oauth signature and token twitter] error
this is my header

OAuth oauth_callback="oob", oauth_consumer_key="8RzStCE91yeZ8lvc0UVAQ", oauth_nonce="13533374952ac", oauth_signature="nRSMBL82riRi63P4QMlR2A9Lh8A%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1353337495", oauth_version="1.0"

and this is my signature base string

POST&http%3A%2F%2Fapi.twitter.com%2Foauth%2Frequest_token&oauth_consumer_key%3DHIDDEN%26oauth_nonce%3DHIDDEN%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1353337495%26oauth_version%3D1.0

and this is my C++ code

	string oAuthHttpHeader = "OAuth oauth_callback=\"oob\", "+oauthQueryString;
	pHttp = new CIwHTTP;
	pHttp->SetRequestHeader("Authorization",oAuthHttpHeader);
	s3eResult r =  pHttp->Post(TWITTER_REQUEST_TOKEN_URL.data(),NULL,0,GotHeader,NULL);

note that i use HTTP not HTTPS
also i use oauthlib library for generating parameters
i checked my system time and it is correct UTC+2 Cairo
what i did wrong to get this error
thanks


#2

i got the same problem here too… needs help :frowning:


#3

I’m not familiar with the Marmalade SDK. But one issue you may having is that you’re specifying a “callback” parameter and not an “oauth_callback” parameter. It also looks like you’re encoding an approximation of an authorization header though I’m not quite sure why…

Please use HTTPS. It will eventually be required for all operations and its best to prepare now.


#4

marmalade is c++ cross platform for gaming
i can’t use HTTPS because marmalade doesn’t support it now
this is url i use to request token
http://api.twitter.com/oauth/request_token
i updated my code and header
thanks for replay


#5

i updated my topic
also this code for mobile app