pstrBase = "POST&" & URLEncode(Request_token_URL) & _
                   "&oauth_callback%3D" & URLEncode("http://
www.mydomain.com/") & _
                   "%26oauth_consumer_key%3D" & Consumer_Key & _
                   "%26oauth_nonce%3D" & pstrTimer & "QP70eNmV" & _
                   "%26oauth_signature_method%3DHMAC_SHA1" & _
                   "%26oauth_timestamp%3D" & pstrTimer & _
                   "%26oauth_version%3D1.0"

Calculate the signature using HMAC-SHA1   (i check the algorithm with
an example in twitter help)
with this base and Consumer_secret + "&"

Post message:

POST https://api.twitter.com/oauth/request_token HTTP/1.1
Host: api.twitter.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:
1.9.1.9) Gecko/20100315 Firefox/3.5.9
Content-Type: application/x-www-form-urlencoded
Content-Length: 232
Connection: keep-alive

oauth_callback=http%3A%2F%2Fwww.mydomain.com%2F&oauth_consumer_key=" +
Consumer_secret  + "
&oauth_nonce=63899QP70eNmV&oauth_signature=pO802kFfXwaAOlq8PbcNqVbtvU4=&oauth_signature_method=HMAC_SHA1&oauth_timestamp=63899&oauth_version=1.0

Always i receive HTTP/1.1 401 Unauthorized and Failed to validate
oauth signature and token

Can anyone help me, please. What is wrong? Thanks.

Reply via email to