0
votes

I am trying to connect twitter using twitter-codeigniter library in php. This library uses twitteroauth lib for the authorization.

As the step1, i load the library and call redirect function with the required callback as parameter.

$this->load->library('twconnect'); 
$this->twconnect->twredirect('http://myserver.net/twconnect/callback/');

And in the callback, all the required steps of the twitter authorization are performed. This works fine for the first time. But performing twitter connection again, throws me following error:

Message: Undefined index: oauth_token
Filename: libraries/twconnect.php
Line Number: 128

While exploring this error, i found that this error is thrown inside the twconnect->twredirect() function. It requests twitter for the outh token using twitteroauth library, but this request fails with following error and no oauth_token returns.

Failed to validate oauth signature and token

I searched for this error in stackoverflow, and many people suggests to fix the timesync problem between local and twitter server time. I have already fixed this. Still, problem is unsolved.

I guess this library sets some token information into the session for the first time. Somehow due to this, the oauth token request is failing after first time. Please help if somebody knows the fix of this error.

1

1 Answers

0
votes

oauth_token might not be passed because Code Igniter prevents the oauth_token variable in the query string.

Similar question here: Enable Query Strings in Code Igniter