Can't Get oauth_token always empty


I am trying to make twitter login with my domain, but every time, I getting error.
Whoa there!
There is no request token for this page. That’s the special key we need from applications asking to use your Twitter account. Please go back to the site or application that sent you here and try again; it was probably just a mistake.

Can u guide me Why it’s not working… Does my domain blacklist by twitter api ? Because when i test my code with another domain its working :frowning:
what should i do ?


How are you generating the request token? Are you using a third-party library? Did you register an application with Twitter and get a consumer key/secret?


yes register an application with Twitter and get a consumer key/secret
Code works on another domain good but when i try it on my main domain not working oauth_token= missing

my login php code is here

require 'twiOauth/twconfig.php';
$twitteroauth = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
$request_token = $twitteroauth->getRequestToken('');
$_SESSION['oauth_token'] = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
$url = $twitteroauth->getAuthorizeURL($request_token['oauth_token']);
header('Location: ' . $url);

// getTwitterData.php

require 'twiOauth/twconfig.php';
if (!empty($_GET['oauth_verifier']) && !empty($_SESSION['oauth_token']) && !empty($_SESSION['oauth_token_secret'])) {
    // We've got everything we need
    $twitteroauth = new TwitterOAuth(YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
// Let's request the access token
    $access_token = $twitteroauth->getAccessToken($_GET['oauth_verifier']);
// Save it in a session var
    $_SESSION['access_token'] = $access_token;

i am using this library


 * Abraham Williams (
 * The first PHP Library to support OAuth for Twitter's REST API.

/* Load OAuth lib. You can find it at */

 * Twitter OAuth class
class TwitterOAuth {
  /* Contains the last HTTP status code returned. */
  public $http_code;
  /* Contains the last API call. */
  public $url;
  /* Set up the API root URL. */
  public $host = "";
  /* Set timeout default. */
  public $timeout = 30;
  /* Set connect timeout. */
  public $connecttimeout = 30; 
  /* Verify SSL Cert. */
  public $ssl_verifypeer = FALSE;
  /* Respons format. */
  public $format = 'json';
  /* Decode returned json data. */
  public $decode_json = TRUE;
  /* Contains the last HTTP headers returned. */
  public $http_info;
  /* Set the useragnet. */
  public $useragent = 'TwitterOAuth v0.2.0-beta2';
  /* Immediately retry the API call if the response was not successful. */
  //public $retry = TRUE;


finaly i found the problem this code not works on hostgator server
i check it on dreamhost it problem is server side
how i fix it ?

I have hostgator server baby plan.


I’m not familiar with hostgator. Maybe they have a support forum you can get help in.


i submitted support ticket :worried: lets see what’s error. i trying since 4 hour but not working.