Callback for twitteroauth


I am trying to use the twitteroauth library to do all of my authentication, but whenever i put a value in the callback url it breaks the php script and does not send me to twitter’s authentication page for my app.

Here is the config file code.

<?php define('Consumer_Key', 'pD82pJSXyQOs68jlCaGW1g'); define('Consumer_Secret', '1AI7nyJKtQ1xQEhEI766Ze6V980sQYhay9zPT5gk'); define('Oauth_Callback', ''); ?>

Here is the code for the page that is sending the user to twitter for authentication/authorization

<?php require("twitteroauth.php"); require("config.php"); session_start(); $twitter = new TwitterOAuth(Consumer_Key, Consumer_Secret); $temp = $twitter->getRequestToken(); $_SESSION['oauth_token'] = $token = $temp['oauth_token']; $_SESSION['oauth_token_secret'] = $temp['oauth_token_secret']; if($twitter->http_code == 200) { $url = $twitter->getAuthorizeURL($token, FALSE); header('Location: ' . $url); } ?>

i have tried putting the Oauth_Callback constant in the url for getRequestToken and it breaks the script every time. Any help would be appreciated.


i have a same problem :smiley: