1

I have created an twitter application.After enter my Username and password it gives us the PIN and send an Instructions that go to the application back and enter your PIN.Where I have to Enter this PIN.To Authorize My Authentication.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Guruver
  • 21
  • 3

1 Answers1

3

For your app to directly use the PIN you need to use the "Call Back URL" (mention some dummy Call Back URL while you create the app in dev.twitter.com . DO NOT Leave it blank). Basically what this does is when you authorize the app to use Twitter data, the web view sends(redirects) the auth data (PIN for the logged in user) to your app. So in your app you need to handle this resumption by overriding
public void onNewIntent(Intent intent) method.

Then get the URI
Uri uri = intent.getData();

From the URI get the verifier
String verifier = uri.getQueryParameter(OAuth.OAUTH_VERIFIER);

THen use that verifier to get the access token
new RetrieveAccessTokenTask().execute(verifier);

Hope this helps

Previously in twitter developer site while creating a new app you used to get the browser/client option. Now you don't have that "application type" option. But it really doesn't make a difference now.

Gadenkan
  • 1,691
  • 2
  • 17
  • 29