在iPhone中使用OAuth进行Twitter注销

问题描述:

我正在使用 http://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master 用于我的iPhone应用程序中的Twitter + Oauth.我正在创建一个音乐应用程序,用户可以在其中登录和注销Twitter.这个特殊的Twitter + Oauth实现不使用会话,因此我不确定它是如何工作的.

I'm using http://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master for Twitter+Oauth in my iPhone app.I am creating a music application where user can login and log out of twitter. This paticular Twitter+Oauth implementation doesn't use sessions, so I'm not sure how this works.

有人有经验吗?如果可以,我该如何注销?

Does anyone have experience with this and if so how would I go about logging out?

我相信这个问题具有有效的答案为你.为了方便起见,我将在此处发布摘要.

I believe this question has answers that will work for you. I'll post summaries here for convenience.

来自 Ryan McGeary :

与Twitter的会话定义为Twitter拥有的Cookie-您无法控制.你无法从Twitter上注销他们他们的代表.

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.

如果您希望某人能够使用您的切换Twitter帐户"功能,您需要通过他们再次进行OAuth握手,但使用/oauth/authorize 路径代替/oauth/authenticate 小路.这将使用户能够在以下位置切换其用户凭据握手时使用Twitter代替只是使用他们的身份进行重新验证现有的Twitter会话.

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.

来自亚伯拉罕 :

您可以使用 oauth/authenticate 并添加 force_login = true http://dev.twitter.com/doc/get/oauth/authenticate *.这将提示用户登录表格.

You can use oauth/authenticate and add force_login=true as specified in http://dev.twitter.com/doc/get/oauth/authenticate*. This will prompt the user with a login form.

**更新了对最新文档的引用*

**updated reference to most recent documentation*

如果以上任何一个答案对您都有用,请确保点击链接并注明原文.

If any of answers above work for you, be sure to follow the link and upvote the originals.