duanlanqian9974 2012-01-12 23:59
浏览 204
已采纳

创建Twitter登录应用程序

In the past few weeks I've been developing a custom PHP login class that I will share with the rest of the devs in just a matter of days or weeks, depending on how quick I'll move with what I'm about to ask next.

So my question would be, how would I make an Twitter login for my existing login app ?

As more info, I'm using a database to store the username, the hash of the password ( a complex algorithm I've been working on most of the time does that, so it's pretty secure for now ), and the email address, also some other info that it's not relevant in here.

That is why I ask, because I've seen some examples and tutorials on how this would work but none use a database. The thing is I need somehow to have the credentials stored in the same database ( with the new columns added as necessary ) and when the user want's to login, the credentials would just be checked against the db instead of going to twitter again.

Also, only if the user is registered in my database, he could sign in with twitter, I'm not sure if this is possible.

Anyway, the main question is how would I create a Twitter login and use the database in the same time ?

  • 写回答

1条回答 默认 最新

  • dongqiongjiong4740 2012-01-13 00:08
    关注

    Twitter used to use basic authentication, but now uses OAuth, so you wouldn't be passing the password but having the user authorize your application via Twitter's OAuth page. There are several tutorials and libraries out in the world to help you do this, or you can read Twitter's documentation on implementing sign-in with Twitter.

    What you'll store in your database after authenticating is the user's OAuth credentials (oauth token and secret) for future requests.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥15 Oracle触发器记录修改前后的字段值
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题