如何使用Twitter API注销用户帐户 [英] How to logout user account using twitter api

查看:679
本文介绍了如何使用Twitter API注销用户帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 有什么方法可以使用twitter API注销用户的twitter帐户.
在我的应用程序中,我要将用户发送到Twitter身份验证页面,它将要求他们登录以发送推文.一旦发送推文,它们仍保持登录状态.就像每次输入用户名和密码一样,我都需要.发送推文后,我必须注销其Twitter帐户.

有没有办法做到这一点.请帮助我.

在此先感谢
Govind

Hi Is there any way we can logout the users twitter account using twitter API.?

In my application i am sending my users to twitter authentication page,it will asks them to login to send a tweet.Once they send a tweet they still remain on login status.I need like every time they should enter their user name and password.that is after sending tweet i must logout their twitter account.

Is there any ways to do this.Plz help me out in this.

Thanks in advance
Govind

推荐答案

来自堆栈溢出

http://stackoverflow.com/questions/1960957/twitter-api-logout [ ^ ]

与Twitter的会话由Twitter拥有的cookie定义-您无法控制这些.您不能代表他们从Twitter注销.

如果您希望某人能够使用切换Twitter帐户"功能,则需要再次将其传递给OAuth握手,但要使用/oauth/authorize路径而不是/oauth/authenticate路径.这将允许用户在握手期间在Twitter上切换其用户凭据,而不仅仅是使用现有的Twitter会话重新进行身份验证.

或者,您可以在自己的应用程序中有一个单独的用户概念,即您拥有自己的用户模型,该模型具有与之关联的许多twitter帐户.这样,您可以允许您的用户更轻松地切换帐户.他们将必须预先为其每个Twitter帐户授权您的应用程序,但是此后,您将拥有其每个Twitter帐户的所有oauth密钥.
From stack overflow

http://stackoverflow.com/questions/1960957/twitter-api-logout[^]

The session with Twitter is defined by a cookie owned by Twitter -- something you do not have control over. You cannot log them out of Twitter on their behalf.

If you want someone to be able to use your "switch twitter account" functionality, you''ll need to pass them off to the OAuth handshake again, but use the /oauth/authorize path instead of the /oauth/authenticate path. This will allow the user to switch their user credentials at Twitter during the handshake instead of just re-authenticating using their existing Twitter session.

Alternatively, you could have a separate notion of users in your own app whereby you have your own user model that has many twitter accounts associated with it. That way, you could allow your users to switch accounts more seemlessly. They would have to authorize your app up front for each of their twitter accounts, but you would have all their oauth keys for each of their twitter accounts after that.


这篇关于如何使用Twitter API注销用户帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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