如何在 mysql 数据库中存储 twitter oauth 详细信息? [英] How to store twitter oauth details in mysql database?

查看:49
本文介绍了如何在 mysql 数据库中存储 twitter oauth 详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个基本的 twitter oauth 应用程序!这是代码 -

I am developing a basic twitter oauth app! Here's the code -

$twitterObj = new EpiTwitter($consumer_key, $consumer_secret);
$oauth_token = $_GET['oauth_token'];
    if($oauth_token == '')
      { 
        $url = $twitterObj->getAuthorizationUrl();
        echo "<div style='width:200px;margin-top:200px;margin-left:auto;margin-  right:auto'>";
        echo "<a href='$url'>Sign In with Twitter</a>";
        echo "</div>";
     } 
    else
      {
        $twitterObj->setToken($_GET['oauth_token']);
        $token = $twitterObj->getAccessToken();
        $twitterObj->setToken($token->oauth_token, $token->oauth_token_secret);     
        $_SESSION['ot'] = $token->oauth_token;
        $_SESSION['ots'] = $token->oauth_token_secret;
        $twitterInfo= $twitterObj->get_accountVerify_credentials();
        $twitterInfo->response;
        $username = $twitterInfo->screen_name;
        $profilepic = $twitterInfo->profile_image_url;
        include 'update.php';

     } 

现在告诉我编码过程如何保存用户登录详细信息!

so now tell me the coding process how can I save the user login details!

推荐答案

加密身份验证令牌及其秘密,并将它们加密存储在数据库中.查看此处了解更多信息

Encrypt the auth token and its secret and store them in the database encrypted. See here for more information

这篇关于如何在 mysql 数据库中存储 twitter oauth 详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆