Twitter API - Logout

elado picture elado · Dec 25, 2009 · Viewed 26.5k times · Source

I'm using OAuth in my web app, and users can login with twitter.

I want to add "switch twitter account" button, which actually clears the session and then opens the authorize_url.

As clearing the session in my web app doesn't log out of twitter, the authorize_url will automatically authenticate the current twitter.com user. That means I can't do logout, unless I send the user to twitter.com.

Is it possible with the API? What is the best way to implement this?

Answer

abraham picture abraham · Dec 29, 2009

You can use oauth/authenticate and add force_login=true as specified in GET oauth/authenticate. This will prompt the user with a login form.