Failed to validate oauth signature and token


#1

Hi.

I’m doing my own library Twitter, but I have trouble generating the first step (which is the collection of the “request_token” This step assumes that you send some information to the servers and if api.twitter.com well-formed information, the server must respond with the values: oauth_token, oauth_token_secret and oauth_callback_confirmed.

I am doing the steps (according to me well) according as the manual says “Implementing Sign in with Twitter” (https://dev.twitter.com/docs/auth/implementing-sign-twitter).

On my code, I created a library to call “sockets_io.php” where I have the function that connects the socket and allows you to send POST data flow and / or GET using “sockets” or “curl”.

And a second code that is “twitter.php” where are the main functions to facilitate the whole process, from connection, content publishing, etc …

The codes are:

socket_io v2.1 - http://pastebin.com/UGx85w3T
twitter v2.0 - http://pastebin.com/xLHk29dy

The code I use for testing is:

# incluir librerias de arriba 

$r= twitter_request_token( 'socket' );
 
echo '<h1>Result</h1><p>';
print_r($r);
echo '</p>';

The error I get is: http://pastebin.com/8jANcZ4s.

Someone who can help me? …
Check out the link I get the error, there will see the Base String, Plot coming out and the results (answer the twitter server).


#2

This is quite an undertaking.

Glancing at the error you provided a paste to, it looks like your signature base string contains a number of commas to separate parameters rather than the escaped “&” character. I’d start there.


#3

Thanks for your answer @episod

The problem still continues, but I updated the information of the error: http://pastebin.com/8jANcZ4s

Look the BASE STRING, is fixed buy the same error :frowning:


#4

I update my error message, i worked in the system clock, but this is ok…

My problem still continue… :(, help !

http://pastebin.com/8jANcZ4s