简体   繁体   English

在iPhone中使用OAuth进行Twitter注销

[英]Twitter logout using oauth in iphone

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. 我在iPhone应用程序中为Twitter + Oauth使用http://github.com/bengottlieb/Twitter-OAuth-iPhone/tree/master ,我正在创建一个音乐应用程序,用户可以在其中登录和注销Twitter。 This paticular Twitter+Oauth implementation doesn't use sessions, so I'm not sure how this works. 这个特殊的Twitter + Oauth实现不使用会话,因此我不确定它是如何工作的。

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. 为了方便起见,我将在此处发布摘要。

From Ryan McGeary : 来自Ryan McGeary

The session with Twitter is defined by a cookie owned by Twitter -- something you do not have control over. 与Twitter的会话由Twitter拥有的cookie定义-您无法控制这些。 You cannot log them out of Twitter on their behalf. 您不能代表他们从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. 如果您希望某人能够使用“切换Twitter帐户”功能,则需要再次将其传递给OAuth握手,但要使用/oauth/authorize路径而不是/oauth/authenticate路径。 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. 这将允许用户在握手期间在Twitter上切换其用户凭据,而不仅仅是使用现有的Twitter会话进行重新身份验证。

From abraham : 亚伯拉罕

You can use oauth/authenticate and add force_login=true as specified in http://dev.twitter.com/doc/get/oauth/authenticate *. 您可以使用oauth/authenticate并按照http://dev.twitter.com/doc/get/oauth/authenticate *中的指定添加force_login=true 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. 如果以上答案对您有帮助,请务必点击链接并注明正本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM