Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 29-Jul-11 4:00am
v3

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900