Can i get request token when using ip as domain name or not?


#1

I can get request token when using domain name, but when i used ip as domain name, it doesn’t work.

Here is my code:

//using domain name
$twitteroauth = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
// Requesting authentication tokens, the parameter is the URL we will be redirected to
$request_token = $twitteroauth->getRequestToken(‘http://abc.com/getTwitterData.php’);

//using ip as domain name
$twitteroauth = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
// Requesting authentication tokens, the parameter is the URL we will be redirected to
$request_token = $twitteroauth->getRequestToken(‘http://203.189.100.95/getTwitterData.php’);

Note: getTwitterData.php = is a page that get data from twitter

Does it has any solution to get request token when using ip as domain name or not?

Thank in advance!


#2

As long as you have a placeholder callback set on your application record, and the URL you’re presenting in your oauth_callback parameter is a fully qualified, valid URL you should be able to use IP addresses as part of that URL.