Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Twitter support OAuth 2.0?

I want to integrate Twitter with my Android application. Can I do this using OAuth 2.0?

I have searched the internet but couldn't find any good explanation regarding this. If anyone has done this before, can you please guide me through this. I saw in a old post here that Twitter doesn't support OAuth 2.0.

like image 272
Spring Breaker Avatar asked May 27 '13 09:05

Spring Breaker


People also ask

Does Twitter use OAuth?

Twitter allows you to obtain user access tokens through the 3-legged OAuth flow, which allows your application to obtain an access token and access token secret by redirecting a user to Twitter and having them authorize your application.

What authentication does Twitter use?

Most of Twitter's Enterprise APIs require HTTP Basic Authentication. This consists of a valid email address and password combination passed as an authorization header for each API request.

What is OAuth in Twitter API?

OAuth 1.0a allows an authorized Twitter developer App to access private account information or perform a Twitter action on behalf of a Twitter account.

How do I get my Twitter OAuth token?

Generating access tokensLogin to your Twitter account on developer.twitter.com. Navigate to the Twitter app dashboard and open the Twitter app for which you would like to generate access tokens. Navigate to the "Keys and Tokens" page. Select 'Create' under the "Access token & access token secret" section.


1 Answers

Basically, no, Twitter still uses OAuth 1.0a for most parts of their backend. Since march however, they support the OAuth 2 client credentials flow for application-only authentication.

This means, if you:

  • have an application that only shows tweets from other users or stuff like that, you can get authorized using OAuth 2.
  • want any users to use your app to post tweets or do anything else on a user's behalf, you have to struggle with OAuth 1.0a.

You should check out the Twitter4J library, which abstracts most of the OAuth 1 hassle away from you.

like image 145
Jan Gerlinger Avatar answered Sep 20 '22 16:09

Jan Gerlinger