twitter-async icon indicating copy to clipboard operation
twitter-async copied to clipboard

Fatal error when changing callback url

Open Djinner opened this issue 13 years ago • 9 comments

Hi,

This error appears when I want to specify my callback url during a twitter authentication process :

Fatal error: Uncaught exception 'EpiOAuthUnauthorizedException' in /home/bt/public_html/chatons/4dm1n/lib/twitter/EpiOAuth.php:432 Stack trace: #0 /home/bt/public_html/chatons/4dm1n/lib/twitter/EpiOAuth.php(404): EpiOAuthException::raise(Object(EpiCurlManager), false) #1 /home/bt/public_html/chatons/4dm1n/lib/twitter/EpiOAuth.php(45): EpiOAuthResponse->__get('oauth_token') #2 /home/bt/public_html/chatons/signin.php(18): EpiOAuth->getAuthenticateUrl(NULL, Array) #3 /home/bt/public_html/chatons/index.php(24): require('/home/bt/public...') #4 {main} thrown in /home/bt/public_html/chatons/4dm1n/lib/twitter/EpiOAuth.php on line 432

I have followed your instructions at this url http://www.jaisenmathai.com/articles/twitter-async-documentation.html#oauthcallback, and I have commented the lines 171 & 172 from Epi0Auth.php file.

There is my code :

$Twitter = new EpiTwitter($consumerKey, $consumerSecret); $customCallback = 'http://www.mydomain.com/index.php?myid'.$photoId; echo 'sign in with twitter';

Do you have any idea to enlight me on this issue ?

By the way, thank's you very mutch for your API !

Djinner avatar Dec 19 '11 17:12 Djinner

I forgot one line in my precedent post, there is the good one :

$Twitter = new EpiTwitter($consumerKey, $consumerSecret); $customCallback = 'http://www.mydomain.com/index.php?myid'.$photoId; $customUrl = $Twitter->getAuthenticateUrl(null,array('oauth_callback' => $customCallback));

echo ' sign in with twitter';

with href="'.$customUrl.'"

Djinner avatar Dec 19 '11 17:12 Djinner

Does simpleTest.php work?

jmathai avatar Dec 19 '11 21:12 jmathai

I have the same Fatal Error

Fatal error: Uncaught exception 'EpiOAuthUnauthorizedException' in /home/dhenriquez/dev.dhenriquez.com/nav2011/EpiOAuth.php:432 Stack trace: #0 /home/dhenriquez/dev.dhenriquez.com/nav2011/EpiOAuth.php(404): EpiOAuthException::raise(Object(EpiCurlManager), false) #1 /home/dhenriquez/dev.dhenriquez.com/nav2011/EpiOAuth.php(45): EpiOAuthResponse->__get('oauth_token') #2 /home/dhenriquez/dev.dhenriquez.com/nav2011/index.php(9): EpiOAuth->getAuthenticateUrl(NULL, Array) #3 {main} thrown in /home/dhenriquez/dev.dhenriquez.com/nav2011/EpiOAuth.php on line 432

dhenriquez avatar Dec 21 '11 20:12 dhenriquez

@dhenriquez does simpleTest.php work for you?

jmathai avatar Dec 28 '11 02:12 jmathai

test.php work fine with 4 string: consumer secret and key, token and secret but, when I try sign in with a custom call back show me the previus commented error.

dhenriquez avatar Dec 28 '11 02:12 dhenriquez

@dhenriquez I don't remember but I believe the callback url needs to be urlencoded.

$customUrl = $Twitter->getAuthenticateUrl(null,array('oauth_callback' => urlencode($customCallback)));

Try that.

jmathai avatar Jan 02 '12 03:01 jmathai

Guys, check date on your server.

Rpsl avatar Feb 07 '12 17:02 Rpsl

@Rpsl thanks. Also, here are some common errors (including server date).

http://www.jaisenmathai.com/articles/twitter-async-documentation.html#commonerrors

jmathai avatar Feb 07 '12 17:02 jmathai

Hello,

I am sorry for reopening this, but do you find some way to solve it? I have this problem too. :P

Kind regards,

Alfonso.

almacbe avatar May 29 '12 15:05 almacbe