开发者

Twitter OAuth Login and Redirect

开发者 https://www.devze.com 2023-02-25 07:01 出处:网络
I am attempting to automatically login to twitter using the OAUTH and php. I have successfully created the connection and can login / tweet successfully using the following code:

I am attempting to automatically login to twitter using the OAUTH and php. I have successfully created the connection and can login / tweet successfully using the following code:

$connection = new TwitterOAuth(
    'consumer_key', 
    'consumer_secre开发者_高级运维t', 
    'oauth_token',
    'oauth_token_secret'
);
$credentials = $connection->get('account/verify_credentials');
echo "Connected as @" . $credentials->screen_name;
$connection->post('statuses/update', array('status' => 'ello world'));

However, instead of tweeting I would like to redirect the user to twitter.com, and have them already logged in.

Is there something within the API that can allow me to do this?


There is no way to log a user into twitter.com with an OAuth access token. The only way a user can get an authenticated session with twitter.com is by submitting the login form with their username/password.

0

精彩评论

暂无评论...
验证码 换一张
取 消